-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (52 loc) · 1.56 KB
/
Copy pathdeploy-prototype.yml
File metadata and controls
63 lines (52 loc) · 1.56 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
name: Deploy Prototype to GitHub Pages
on:
push:
branches: [main]
paths: ['design/prototype/**']
workflow_dispatch: # allow manual trigger
concurrency:
group: pages
cancel-in-progress: true
permissions:
contents: read
pages: write
id-token: write
jobs:
deploy:
name: Deploy
runs-on: ubuntu-24.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
- uses: actions/configure-pages@v4
- name: Generate analytics config from GitHub secrets
shell: bash
env:
POSTHOG_TOKEN: ${{ secrets.POSTHOG_TOKEN }}
POSTHOG_API_HOST: ${{ vars.POSTHOG_API_HOST }}
POSTHOG_VERSION: ${{ vars.POSTHOG_VERSION }}
run: |
if [ -z "${POSTHOG_TOKEN}" ]; then
echo "::error title=Missing POSTHOG_TOKEN::POSTHOG_TOKEN secret is required for deployment."
exit 1
fi
if [ -z "${POSTHOG_API_HOST}" ]; then
POSTHOG_API_HOST="https://us.i.posthog.com"
fi
if [ -z "${POSTHOG_VERSION}" ]; then
POSTHOG_VERSION="v1-gh-pages"
fi
cat > design/prototype/assets/analytics.config.local.json <<EOF
{
"token": "${POSTHOG_TOKEN}",
"apiHost": "${POSTHOG_API_HOST}",
"version": "${POSTHOG_VERSION}"
}
EOF
- uses: actions/upload-pages-artifact@v3
with:
path: design/prototype/
- uses: actions/deploy-pages@v4
id: deployment