feat: Add workflow to sync build assets to CDN #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: Sync build assets to CDN | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Website | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm install | |
- name: Build | |
run: npm run build | |
- name: Sync build assets | |
uses: patrickwyler/[email protected] | |
with: | |
secrets: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_CREDENTIALS }} | |
bucket: "tiara-assets" | |
exclude: '.*\.md$|\.gitignore$|\.git/.*$|\.github/.*$' | |
sync_dir_from: ".next/static" | |
sync_dir_to: "assets/_next/static" | |