Skip to content

Commit

Permalink
Update deployment workflow to use Cloudflare Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
simonerlic committed Jun 17, 2024
1 parent 1c55243 commit 1793b22
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Deploy site

on:
push:
branches:
- master
workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "14"
- name: Install dependencies
run: npm install
- name: Build
run: npm run build

deploy:
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
deployments: write
steps:
- uses: actions/checkout@v4
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ env.CLOUDFLARE_ACCOUNT_ID }}
projectName: website
directory: ./dist
# Optional: Enable this if you want to have GitHub Deployments triggered
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
# Optional: Switch what branch you are publishing to.
# By default this will be the branch which triggered this workflow
branch: main

0 comments on commit 1793b22

Please sign in to comment.