Merge pull request #193 from compolabs/fix/correct-quote-asset-id #347
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: Cloudflare Pages Deploy | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
pull_request: | |
branches: | |
- main | |
jobs: | |
deploy: | |
environment: | |
name: | |
${{ (github.ref == 'refs/heads/main' && 'production') || (github.ref == 'refs/heads/develop' && 'dev') || | |
'preview' }} | |
permissions: | |
actions: read # Only required for private GitHub Repo | |
contents: read | |
deployments: write | |
pull-requests: write | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: "Checkout Github Action" | |
uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
cache: "pnpm" | |
- name: Install Dependencies | |
run: | | |
pnpm install | |
- name: create env file | |
run: | | |
touch .env | |
echo VITE_FEATURE_TOGGLE_CLIENT_KEY=${{ vars.VITE_FEATURE_TOGGLE_CLIENT_KEY }} >> .env | |
- name: Build Project | |
run: | | |
npm run build | |
- name: "Deploy to Cloudflare Pages" | |
uses: andykenward/github-actions-cloudflare-pages@v2.3.1 | |
with: | |
cloudflare-api-token: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
cloudflare-account-id: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
cloudflare-project-name: ${{ github.event.repository.name }} | |
directory: build | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
github-environment: ${{ (github.ref == 'refs/heads/main' && 'production') || 'preview' }} |