diff --git a/.github/workflows/ab-testing-checks.yml b/.github/workflows/ab-testing-checks.yml index 4085b17a42c..e9167806d27 100644 --- a/.github/workflows/ab-testing-checks.yml +++ b/.github/workflows/ab-testing-checks.yml @@ -20,6 +20,7 @@ on: jobs: checks: runs-on: ubuntu-latest + name: Checks defaults: run: working-directory: ab-testing diff --git a/.github/workflows/ab-testing-deploy-code.yml b/.github/workflows/ab-testing-ci-code.yml similarity index 93% rename from .github/workflows/ab-testing-deploy-code.yml rename to .github/workflows/ab-testing-ci-code.yml index ebd6a59f76a..85b5f9ca826 100644 --- a/.github/workflows/ab-testing-deploy-code.yml +++ b/.github/workflows/ab-testing-ci-code.yml @@ -1,4 +1,4 @@ -name: 🧪 Deploy CODE AB Testing Config +name: 🧪 AB testing CI (CODE) permissions: contents: read diff --git a/.github/workflows/ab-testing-ci.yml b/.github/workflows/ab-testing-ci.yml index 20be564fd32..9aa98702ba3 100644 --- a/.github/workflows/ab-testing-ci.yml +++ b/.github/workflows/ab-testing-ci.yml @@ -7,10 +7,31 @@ on: pull_request: paths: - 'ab-testing/**' + - '.github/workflows/ab-testing-*.yml' + push: + branches: + - main + paths: + - 'ab-testing/**' + - '.github/workflows/ab-testing-*.yml' jobs: - checks: + ci: + name: CI uses: ./.github/workflows/ab-testing-checks.yml + with: + save_build_artifact: true + secrets: + FASTLY_AB_TESTING_CONFIG: ${{ secrets.FASTLY_PROD_AB_TESTING_CONFIG }} + FASTLY_API_TOKEN: ${{ secrets.FASTLY_PROD_API_TOKEN }} + + deploy: + name: Deploy + needs: ci + if: github.ref == 'refs/heads/main' + uses: ./.github/workflows/ab-testing-deploy.yml + with: + stage: prod secrets: - FASTLY_AB_TESTING_CONFIG: ${{ secrets.FASTLY_CODE_AB_TESTING_CONFIG }} - FASTLY_API_TOKEN: ${{ secrets.FASTLY_CODE_API_TOKEN }} + FASTLY_AB_TESTING_CONFIG: ${{ secrets.FASTLY_PROD_AB_TESTING_CONFIG }} + FASTLY_API_TOKEN: ${{ secrets.FASTLY_PROD_API_TOKEN }} diff --git a/.github/workflows/ab-testing-deploy-prod.yml b/.github/workflows/ab-testing-deploy-prod.yml deleted file mode 100644 index 36df148675d..00000000000 --- a/.github/workflows/ab-testing-deploy-prod.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: 🧪 Deploy PROD AB Testing Config - -permissions: - contents: read - -on: - workflow_dispatch: - push: - branches: - - main - paths: - - 'ab-testing/**' - -jobs: - ci: - uses: ./.github/workflows/ab-testing-checks.yml - with: - save_build_artifact: true - secrets: - FASTLY_AB_TESTING_CONFIG: ${{ secrets.FASTLY_PROD_AB_TESTING_CONFIG }} - FASTLY_API_TOKEN: ${{ secrets.FASTLY_PROD_API_TOKEN }} - - deploy: - name: Deploy PROD - needs: ci - uses: ./.github/workflows/ab-testing-deploy.yml - with: - stage: prod - secrets: - FASTLY_AB_TESTING_CONFIG: ${{ secrets.FASTLY_PROD_AB_TESTING_CONFIG }} - FASTLY_API_TOKEN: ${{ secrets.FASTLY_PROD_API_TOKEN }} diff --git a/.github/workflows/ab-testing-ui.yml b/.github/workflows/ab-testing-ui.yml index 7f12912d78c..a954850e7bd 100644 --- a/.github/workflows/ab-testing-ui.yml +++ b/.github/workflows/ab-testing-ui.yml @@ -3,11 +3,13 @@ on: pull_request: paths: - 'ab-testing/**' + - '.github/workflows/ab-testing-*.yml' push: branches: - main paths: - 'ab-testing/**' + - '.github/workflows/ab-testing-*.yml' jobs: build-ui: