-
Notifications
You must be signed in to change notification settings - Fork 5
79 lines (66 loc) · 1.94 KB
/
gh-pages.yml
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
name: publish gh-pages
on:
workflow_dispatch:
workflow_call:
env:
GH_BOT_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
GH_BOT_NAME: "GitHub Action"
DENO_DIR: .deno-cache
REPO: commonhaus/commonhaus.github.io
permissions: {}
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
publish:
runs-on: ubuntu-latest
environment:
name: github-pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# Cancel in-progress runs if a new one is queued
steps:
- name: Setup Deno environment
uses: denoland/setup-deno@v2
with:
deno-version: v1.x
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
ref: 'main'
- name: Cache Deno dependencies
uses: actions/cache@v4
with:
path: ${{ env.DENO_DIR }}
key: ${{ hashFiles('deno.lock') }}
- name: Build site
run: deno task build
- name: Setup Pages
if: github.ref == 'refs/heads/main' && github.repository == ${{ env.REPO }}
id: pages
uses: actions/configure-pages@v5
- name: Upload artifact
if: github.ref == 'refs/heads/main' && github.repository == ${{ env.REPO }}
uses: actions/upload-pages-artifact@v3
with:
path: ./public
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main' && github.repository == ${{ env.REPO }}
id: deployment
uses: actions/deploy-pages@v4
check:
runs-on: ubuntu-latest
needs: publish
if: always()
steps:
- if: ${{ needs.publish.result != 'failure' }}
run: |
echo "Deployment successful"
- if: ${{ needs.publish.result == 'failure' }}
run: |
echo "Deployment failed"
exit 1