diff --git a/.github/workflows/gnulinuxsa-wordpress.yml b/.github/workflows/gnulinuxsa-wordpress.yml new file mode 100644 index 0000000..6d61314 --- /dev/null +++ b/.github/workflows/gnulinuxsa-wordpress.yml @@ -0,0 +1,48 @@ +name: deploy-gnulinuxsa-wordpress + +on: + push: + paths: + - '.github/workflows/gnulinuxsa-wordpress.yml' + - 'gnulinuxsa-wordpress/**' + branches: [main] + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + environment: + name: gnulinuxsa.org + url: https://gnulinuxsa.org + steps: + - name: checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Tailscale + uses: tailscale/github-action@7a0b30ed3517c2244d1330e39467b95f067a33bd + with: + oauth-client-id: ${{ secrets.TAILSCALE_CLIENT_ID }} + oauth-secret: ${{ secrets.TAILSCALE_SECRET }} + tags: tag:deploy-ci + hostname: Github-actions + version: ${{ vars.TAILSCALE_VERSION }} + + - name: Add secrets to compose + env: + MARIADB_PASSWORD: ${{ secrets.gnulinuxsa_wordpress_mariadb_password }} + run: | + sed -i "s|(gnulinuxsa_wordpress_mariadb_password)|$MARIADB_PASSWORD|g" $GITHUB_WORKSPACE/gnulinuxsa-wordpress/docker-compose.yml + + - name: Start Deployment + uses: FarisZR/docker-compose-gitops-action@v1.0.1 + env: + MARIADB_PASSWORD: ${{ secrets.gnulinuxsa_wordpress_mariadb_password }} + with: + remote_docker_host: ${{ secrets.server_address }} + tailscale_ssh: true # no need for manual private and public keys + compose_file_path: gnulinuxsa-wordpress/docker-compose.yml + args: -p gnulinuxsa-wordpress up -d --remove-orphans + upload_directory: true + docker_compose_directory: gnulinuxsa-wordpress \ No newline at end of file diff --git a/gnulinuxsa-wordpress/custom.ini b/gnulinuxsa-wordpress/custom.ini new file mode 100644 index 0000000..5f31c50 --- /dev/null +++ b/gnulinuxsa-wordpress/custom.ini @@ -0,0 +1,5 @@ +file_uploads = On +memory_limit = 256M +upload_max_filesize = 64M +post_max_size = 64M +max_execution_time = 600 \ No newline at end of file diff --git a/gnulinuxsa-wordpress/docker-compose.yml b/gnulinuxsa-wordpress/docker-compose.yml new file mode 100644 index 0000000..08dd459 --- /dev/null +++ b/gnulinuxsa-wordpress/docker-compose.yml @@ -0,0 +1,46 @@ +version: '3.1' + +networks: + default: + enable_ipv6: true + web: + external: true + +services: + wordpress: + image: wordpress:php7.4@sha256:7e46cf3373751b6d62b7a0fc3a7d6686f641a34a2a0eb18947da5375c55fd009 + container_name: gnulinuxsa-wordpress + restart: always + environment: + WORDPRESS_DB_HOST: mariadb + WORDPRESS_DB_USER: wordpress + WORDPRESS_DB_NAME: wordpress + WORDPRESS_DB_PASSWORD: (gnulinuxsa_wordpress_mariadb_password) + networks: + default: + web: + volumes: + - html:/var/www/html:rw + configs: + - source: custom-ini + target: /usr/local/etc/php/conf.d/custom.ini + + mariadb: + image: mariadb:11.2.2@sha256:a9385bb457ebf4600da632cc331f11a5328c582bfb492aa76517282bcae1dcc9 + restart: always + environment: + MARIADB_USER: wordpress + MARIADB_DATABASE: wordpress + MARIADB_PASSWORD: (gnulinuxsa_wordpress_mariadb_password) + MARIADB_RANDOM_ROOT_PASSWORD: '1' + MARIADB_AUTO_UPGRADE: true + volumes: + - mariadb:/var/lib/mysql:rw + +volumes: + mariadb: + html: + +configs: + custom-ini: + file: /home/aosus/gnulinuxsa-wordpress/custom.ini \ No newline at end of file