This repository has been archived by the owner on Dec 4, 2023. It is now read-only.
Testing workflow file #1
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: Build and Deploy | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Build front-end | |
run: | | |
# Assuming you're using npm for building | |
npm install | |
npm run build | |
- name: Install b2 command-line tool | |
run: | | |
pip install b2 | |
- name: Upload to Backblaze B2 | |
run: | | |
# Here, use the b2 command-line tool to upload your assets. | |
# You might want to adapt this step depending on your folder structure. | |
b2 authorize-account ${{ secrets.B2_ACCOUNT_ID }} ${{ secrets.B2_APPLICATION_KEY }} | |
b2 sync --delete --replaceNewer dist/ b2://YOUR_BUCKET_NAME/path/ | |
- name: Invalidate Fastly CDN cache | |
run: | | |
# Assuming each of your assets has a unique surrogate key for precise cache invalidation | |
# Replace "your-surrogate-key" with the relevant surrogate key or mechanism to retrieve it | |
curl -X POST "https://api.fastly.com/service/${{ secrets.FASTLY_SERVICE_ID }}/purge_all" \ | |
-H "Fastly-Key: ${{ secrets.FASTLY_API_KEY }}" \ | |
-H "Accept: application/json" | |