Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add cache clearing step to prevent deployment failure #1484

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading