-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (30 loc) · 1.02 KB
/
deploy-cloudflare.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Build and deploy to Cloudflare Pages
on: push
jobs:
build-and-deploy:
runs-on: ubuntu-22.04
container:
image: node:20.15.1
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install dependencies
run: npm install
- name: Build website
run: npx @11ty/eleventy
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: 11ty-website
if-no-files-found: error
path: site/
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Deploy to Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy site --project-name=11ty-links --branch=${{ steps.extract_branch.outputs.branch }} --commit-dirty=true