-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update deployment workflow to use Cloudflare Pages
- Loading branch information
1 parent
1c55243
commit 1793b22
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
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
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 |