deploy #807
This file contains 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: deploy | |
on: | |
workflow_run: | |
workflows: [ci] | |
types: [completed] | |
branches: [master] | |
workflow_dispatch: {} | |
concurrency: | |
group: deploy | |
cancel-in-progress: true | |
jobs: | |
deploy: | |
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event_name != 'pull_request' }} | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # all history to get the last tagged git commit | |
- uses: actions/cache@v4 | |
with: | |
path: .firebase | |
key: firebase-${{ github.run_id }} | |
restore-keys: | | |
firebase- | |
- uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- run: bun install --frozen-lockfile | |
- run: bun run build | |
- name: Deploy to firebase | |
run: | | |
curl -Lo ./firebase_bin https://firebase.tools/bin/linux/latest | |
chmod +x ./firebase_bin | |
./firebase_bin deploy --only hosting | |
env: | |
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} | |
# - name: Purge CDN | |
# run: | | |
# curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE }}/purge_cache" \ | |
# -H "Authorization: Bearer ${{ secrets.CLOUDFLARE_AUTH }}" \ | |
# -H "Content-Type: application/json" \ | |
# --data '{"purge_everything":true}' |