-
Notifications
You must be signed in to change notification settings - Fork 6
96 lines (81 loc) · 2.57 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: publish
on:
push:
branches:
- 'main'
repository_dispatch:
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
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
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
environment:
name: github-pages
steps:
- name: Setup Deno environment
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache Deno dependencies
uses: actions/cache@v4
with:
path: ${{ env.DENO_DIR }}
key: ${{ hashFiles('deno.lock') }}
- name: Git Config
run: |
git config user.name ${{ env.GH_BOT_NAME }}
git config user.email ${{ env.GH_BOT_EMAIL }}
- name: Git Submodule Update
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git pull --recurse-submodules
git submodule update --init --remote --recursive
deno task lastmod
if git diff --quiet; then
echo "-- No changes -- "
else
git commit -am "🆙 Auto-update submodule references" && git push
fi
- name: Git Discussion Update
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
deno task activity
if git diff --quiet; then
echo "-- No changes -- "
else
git commit -am "💬 Auto-update GH Activity" && git push
fi
- 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@v4
- 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