Repository navigation
92 lines (80 loc) · 2.84 KB
/
Copy pathdeploy-web.yml
File metadata and controls
92 lines (80 loc) · 2.84 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Deploy fizzyed.it: this repo's Zine site (content/, layouts/, assets/ → `zine release`) and two
# builds of the fizzy browser app, made by fizzyedit/fizzy's `web.yml` and left here as release
# assets:
#
# web-main → /app/ the real app, built from fizzy's main
# web-preview → /testapp/ a test build of a fizzy pull request (the latest one), with
# browser storage of its own; absent until there has been one
#
# Pages publishes the whole site at once, so every deploy lays out both, whichever one changed.
# Reading this repo's own releases needs no token beyond the workflow's.
#
# One-time repo setup: Settings → Pages → Build and deployment → Source: GitHub Actions. Set the
# custom domain to fizzyed.it (assets/CNAME is a static asset, so it lands in the published site).
#
# Redeploys on: pushes here that change the site, a repository_dispatch from fizzyedit/fizzy (a new
# build, or a new release the site links), or a manual run.
name: Deploy website
on:
push:
branches: [main]
paths:
- "content/**"
- "layouts/**"
- "assets/**"
- "zine.ziggy"
- ".github/workflows/deploy-web.yml"
repository_dispatch:
types: [fizzy-updated]
workflow_dispatch:
concurrency:
group: deploy-website
cancel-in-progress: true
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout website
uses: actions/checkout@v4
# The version comes from `.zine_version` in zine.ziggy.
- name: Setup Zine
uses: kristoff-it/setup-zine@v2
- name: Build the site
run: zine release
- name: Assemble site
env:
GH_TOKEN: ${{ github.token }}
run: |
mkdir -p site
cp -R public/. site/
# The site's own content, for "Open this site in fizzy" (/app/?open=/site.zip).
(cd content && zip -qr ../site/site.zip . -x '.*')
gh release download web-main --repo "$GITHUB_REPOSITORY" --pattern web.zip --output main.zip
mkdir -p site/app
unzip -q main.zip -d site/app
cat site/app/build.json
if gh release download web-preview --repo "$GITHUB_REPOSITORY" --pattern web.zip --output preview.zip; then
mkdir -p site/testapp
unzip -q preview.zip -d site/testapp
cat site/testapp/build.json
else
echo "No test build yet: /testapp/ is left out."
fi
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: site
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4