Last active
July 26, 2022 19:08
-
-
Save TheJotob/5741b9e74a42aa956f9ebb188917a1d9 to your computer and use it in GitHub Desktop.
Github Action to flush heroku build cache, when npm dependencies change
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Flush Heroku Build Cache | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- yarn.lock | |
jobs: | |
flush-build-cache: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Heroku Login | |
run: | | |
cat > ~/.netrc <<EOF | |
machine api.heroku.com | |
login $HEROKU_EMAIL | |
password $HEROKU_API_KEY | |
EOF | |
env: | |
HEROKU_EMAIL: ${{ secrets.HEROKU_EMAIL }} | |
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} | |
- name: Install heroku:build plugin | |
run: heroku plugins:install heroku-builds | |
- name: Clear Heroku Build Cache | |
run: heroku builds:cache:purge --app your-app-name --confirm your-app-name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment