Repository navigation
62 lines (50 loc) · 1.57 KB
/
Copy pathdeploy.yml
File metadata and controls
62 lines (50 loc) · 1.57 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
name: Deploy
on:
push:
branches: [master]
workflow_dispatch:
repository_dispatch:
types: [blog-updated] # sent by TheDeveloperDen/blog when a post is merged
permissions:
contents: write
concurrency:
group: deploy
cancel-in-progress: false
jobs:
deploy:
name: Release & trigger deploy
runs-on: ubuntu-latest
environment:
name: production
url: https://developerden.org
steps:
- uses: actions/checkout@v7
- uses: oven-sh/setup-bun@v2
- name: Cache Elm packages
uses: actions/cache@v6
with:
path: ~/.elm
key: elm-${{ runner.os }}-${{ hashFiles('elm.json') }}
restore-keys: elm-${{ runner.os }}-
- run: bun install --frozen-lockfile
- name: Build Tailwind modules
run: bun run tw
- name: Build
run: bun run build
- name: Package
run: tar -czf website-dist.tar.gz -C dist .
- name: Create release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "build-${{ github.run_number }}" website-dist.tar.gz \
--title "Build ${{ github.run_number }}" \
--notes "Built from ${{ github.sha }}" \
--target "${{ github.sha }}" \
--latest
- name: Trigger deploy
env:
SECRET: ${{ secrets.DEPLOY_WEBHOOK_SECRET }}
run: |
sig=$(printf '{}' | openssl dgst -sha256 -hmac "$SECRET" | sed 's/.* //')
curl -fsS -X POST -H "X-Hub-Signature-256: sha256=$sig" -d '{}' https://hooks.developerden.org/hooks/website