SEO #82
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 frontend | |
on: | |
push: | |
paths: | |
- .github/workflows/deploy-frontend.yml | |
- "frontend/**/*" | |
branches: | |
- "main" | |
jobs: | |
deploy-frontend: | |
environment: Frontend | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./frontend | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
cache: "npm" | |
cache-dependency-path: frontend/package-lock.json | |
- name: Install dependencies | |
run: npm install | |
- name: Check | |
run: npm run check | |
- name: Build | |
run: npm run build | |
- name: Publish to Cloudflare Pages | |
uses: cloudflare/pages-action@v1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
projectName: sydneybikemap | |
directory: frontend/dist | |
# Optional: Enable this if you want to have GitHub Deployments triggered | |
# gitHubToken: ${{ secrets.GITHUB_TOKEN }} |