diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml index 12ea089d..ce57eb44 100644 --- a/.github/workflows/commit.yml +++ b/.github/workflows/commit.yml @@ -72,11 +72,30 @@ jobs: environ: development secrets: inherit + clear-cache-development: + name: Clear Buildpack Cache (development) + runs-on: ubuntu-latest + environment: development + steps: + - name: Clear buildpack cache + uses: cloud-gov/cg-cli-tools@main + with: + command: > + (for app in catalog-web catalog-admin catalog-fetch catalog-gather catalog-proxy; do + app_guid=$(cf app --guid "$app"); + cf curl -X POST /v3/apps/${app_guid}/actions/clear_buildpack_cache; + done) + cf_org: gsa-datagov + cf_space: development + cf_username: ${{ secrets.CF_SERVICE_USER }} + cf_password: ${{ secrets.CF_SERVICE_AUTH }} + deploy-development: if: github.ref == 'refs/heads/develop' name: deploy (development) needs: - create-cloudgov-services-development + - clear-cache-development uses: gsa/data.gov/.github/workflows/deploy-template.yml@main with: environ: development diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a4c81322..59ed3627 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -54,10 +54,47 @@ jobs: environ: prod secrets: inherit + clear-cache-staging: + name: Clear Buildpack Cache (staging) + runs-on: ubuntu-latest + environment: staging + steps: + - name: Clear buildpack cache + uses: cloud-gov/cg-cli-tools@main + with: + command: > + (for app in catalog-web catalog-admin catalog-fetch catalog-gather catalog-proxy; do + app_guid=$(cf app --guid "$app"); + cf curl -X POST /v3/apps/${app_guid}/actions/clear_buildpack_cache; + done) + cf_org: gsa-datagov + cf_space: staging + cf_username: ${{ secrets.CF_SERVICE_USER }} + cf_password: ${{ secrets.CF_SERVICE_AUTH }} + + clear-cache-prod: + name: Clear Buildpack Cache (prod) + runs-on: ubuntu-latest + environment: prod + steps: + - name: Clear buildpack cache + uses: cloud-gov/cg-cli-tools@main + with: + command: > + (for app in catalog-web catalog-admin catalog-fetch catalog-gather catalog-proxy; do + app_guid=$(cf app --guid "$app"); + cf curl -X POST /v3/apps/${app_guid}/actions/clear_buildpack_cache; + done) + cf_org: gsa-datagov + cf_space: prod + cf_username: ${{ secrets.CF_SERVICE_USER }} + cf_password: ${{ secrets.CF_SERVICE_AUTH }} + deploy-staging: name: deploy (staging) needs: - create-cloudgov-services-staging + - clear-cache-staging uses: gsa/data.gov/.github/workflows/deploy-template.yml@main with: environ: staging @@ -70,6 +107,7 @@ jobs: needs: - create-cloudgov-services-prod - deploy-staging + - clear-cache-prod uses: gsa/data.gov/.github/workflows/deploy-template.yml@main with: environ: prod