-
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.
Merge pull request #188 from himynameisjonas/workflow-test
Deploy to Cloudflare
- Loading branch information
Showing
1 changed file
with
54 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,54 @@ | ||
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | ||
|
||
name: Build and Deploy | ||
|
||
on: | ||
push: | ||
branches: ["master"] | ||
pull_request: | ||
branches: ["master"] | ||
|
||
jobs: | ||
build: | ||
name: "Build and Deploy" | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.10.0 | ||
cache: "yarn" | ||
- run: yarn install --frozen-lockfile | ||
- uses: actions/cache/restore@v4 | ||
id: cache | ||
with: | ||
path: | | ||
.cache | ||
img | ||
key: 11ty-${{ runner.os }}-${{ github.run_id }} | ||
restore-keys: | | ||
11ty-${{ runner.os }} | ||
${{ runner.os }}-11ty | ||
- name: Build 11ty site | ||
run: yarn build | ||
env: | ||
TINA_CLIENT_ID: ${{ secrets.TINA_CLIENT_ID }} | ||
TINA_SEARCH_TOKEN: ${{ secrets.TINA_SEARCH_TOKEN }} | ||
TINA_TOKEN: ${{ secrets.TINA_TOKEN }} | ||
- uses: actions/cache/save@v4 | ||
with: | ||
path: | | ||
.cache | ||
img | ||
key: 11ty-${{ runner.os }}-${{ github.run_id }} | ||
- name: Publish to Cloudflare Pages | ||
uses: cloudflare/pages-action@v1 | ||
with: | ||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
accountId: 8dfec48c278d5a97c93de33e072261bd | ||
projectName: jonas-brusman-se | ||
directory: dist | ||
# Optional: Enable this if you want to have GitHub Deployments triggered | ||
gitHubToken: ${{ secrets.GITHUB_TOKEN }} |