Skip to content

Commit

Permalink
nightlies: cache deployment state to prevent redeployment
Browse files Browse the repository at this point in the history
Deployment eats a lot into our API budget, so avoid it if possible
  • Loading branch information
alaviss committed Sep 13, 2021
1 parent a426470 commit 1533552
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/nightlies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -446,24 +446,40 @@ jobs:
name: 'Update latest tags for ${{ matrix.setting.release }}'
runs-on: ubuntu-latest
steps:
- name: Store build settings
shell: bash
run: |
cat <<< '${{ toJson(matrix.setting) }}' > setting.json
- name: Check whether deployment was done for this setting set
id: deploy-cache
uses: actions/cache@v2
with:
path: setting.json
key: deploy-${{ hashFiles('setting.json') }}-${{ env.nightlies_revision }}

- name: Checkout nightlies
if: steps.deploy-cache.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
path: nightlies

- name: Download generated source package
if: steps.deploy-cache.outputs.cache-hit != 'true'
uses: actions/download-artifact@v2
with:
name: 'nim-${{ matrix.setting.commit }}'
path: source

- name: Download built binaries from artifacts
if: steps.deploy-cache.outputs.cache-hit != 'true'
uses: actions/download-artifact@v2
with:
name: 'binaries-${{ matrix.setting.branch }}-${{ matrix.setting.commit }}'
path: binaries

- name: 'Push latest-${{ matrix.setting.branch }} tag'
if: steps.deploy-cache.outputs.cache-hit != 'true'
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

1 comment on commit 1533552

@alaviss
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI is red since I cancelled this run as we went over the API budget for today.

Please sign in to comment.