From 9ccdb8c0896fbd573c8bc1240562e898eadacf0a Mon Sep 17 00:00:00 2001 From: FarisZR <35614734+FarisZR@users.noreply.github.com> Date: Mon, 21 Oct 2024 22:54:29 +0200 Subject: [PATCH] add aosus-wordpress workflow --- .github/workflows/aosus-wordpress.yml | 51 +++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/aosus-wordpress.yml diff --git a/.github/workflows/aosus-wordpress.yml b/.github/workflows/aosus-wordpress.yml new file mode 100644 index 0000000..eb5bf4e --- /dev/null +++ b/.github/workflows/aosus-wordpress.yml @@ -0,0 +1,51 @@ +name: deploy-aosus-wordpress + +on: + push: + paths: + - '.github/workflows/aosus-wordpress.yml' + - 'aosus-wordpress/**' + branches: [main] + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + environment: + name: aosus.org + url: https://aosus.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.aosus_wordpress_mariadb_password }} + MARIADB_ROOT_PASSWORD: ${{ secrets.aosus_wordpress_mariadb_root_password }} + run: | + sed -i "s|(aosus_wordpress_mariadb_password)|$MARIADB_PASSWORD|g" $GITHUB_WORKSPACE/aosus-wordpress/docker-compose.yml + sed -i "s|(aosus_wordpress_mariadb_root_password)|$MARIADB_ROOT_PASSWORD|g" $GITHUB_WORKSPACE/aosus-wordpress/docker-compose.yml + + - name: Start Deployment + uses: FarisZR/docker-compose-gitops-action@v1.0.1 + env: + MARIADB_PASSWORD: ${{ secrets.aosus_wordpress_mariadb_password }} + MARIADB_ROOT_PASSWORD: ${{ secrets.aosus_wordpress_mariadb_root_password }} + with: + remote_docker_host: ${{ secrets.server_address }} + tailscale_ssh: true # no need for manual private and public keys + compose_file_path: aosus-wordpress/docker-compose.yml + args: -p aosus-wordpress up -d --remove-orphans + upload_directory: true + docker_compose_directory: aosus-wordpress \ No newline at end of file