Skip to content

Commit

Permalink
Merge pull request #188 from himynameisjonas/workflow-test
Browse files Browse the repository at this point in the history
Deploy to Cloudflare
  • Loading branch information
himynameisjonas authored Feb 28, 2024
2 parents 1c9bd95 + 0eb4953 commit 423fdda
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/deploy.yml
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 }}

0 comments on commit 423fdda

Please sign in to comment.