From 66d0c6cfaaa67091e340f0e69414c54e2b530ccf Mon Sep 17 00:00:00 2001 From: Ilya Egorov Date: Thu, 27 Feb 2025 17:24:33 +0300 Subject: [PATCH] Remove Test Domains pipeline --- .github/workflows/remove-td.yml | 38 +++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/remove-td.yml diff --git a/.github/workflows/remove-td.yml b/.github/workflows/remove-td.yml new file mode 100644 index 0000000..5e95892 --- /dev/null +++ b/.github/workflows/remove-td.yml @@ -0,0 +1,38 @@ +name: Remove test domain + +on: + push: + branches: + - td-nature + - td-book + - td-art + +jobs: + build: + runs-on: ubuntu-latest + environment: "${{ github.ref == 'refs/heads/main' && 'production' || github.ref == 'refs/heads/canary' && 'canary' || github.ref == 'refs/heads/staging' && 'staging' || startsWith(github.ref, 'refs/heads/td-') && 'testing' || 'unknown' }}" + env: + JOB_ENV: "${{ github.ref == 'refs/heads/main' && 'production' || github.ref == 'refs/heads/canary' && 'canary' || github.ref == 'refs/heads/staging' && 'staging' || startsWith(github.ref, 'refs/heads/td-') && 'testing' || 'unknown' }}" + APP_ENV: "${{ github.ref == 'refs/heads/main' && 'production' || github.ref == 'refs/heads/canary' && 'canary' || github.ref == 'refs/heads/staging' && 'staging' || startsWith(github.ref, 'refs/heads/td-') && format('{0}{1}', 'testing-', github.ref_name) || 'unknown' }}" + APP_DOMAIN: "${{ startsWith(github.ref, 'refs/heads/td-') && format('{0}{1}', github.ref_name, vars.APP_DOMAIN_TESTING) || github.ref == 'refs/heads/staging' && vars.APP_DOMAIN_STAGING || vars.APP_DOMAIN }}" + + permissions: + packages: write + contents: read + + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ vars.AWS_REGION }} + + - id: lower-repo + name: Repository to lowercase + run: | + echo "repository=${GITHUB_REPOSITORY@L}" >> $GITHUB_OUTPUT + + - name: Deploy ${{ vars.APP_NAME }} to Kubernetes + run: | + helm uninstall ${{ vars.APP_NAME }} ./helm/app --namespace ${{ vars.APP_NAME }}-${{ env.APP_ENV }}