-
Notifications
You must be signed in to change notification settings - Fork 54
85 lines (73 loc) · 2.38 KB
/
deploy-website.yml
File metadata and controls
85 lines (73 loc) · 2.38 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
name: Deploy website
on:
push:
branches:
- main
paths:
- 'website/**'
workflow_dispatch:
jobs:
deploy:
environment: release
runs-on: ubuntu-latest
permissions:
contents: write
deployments: write
statuses: write
pull-requests: write
steps:
- name: Checkout main branch
uses: actions/checkout@v6
- name: Deploy website directory to website branch
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./website
publish_branch: website
keep_files: true
destination_dir: api
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: ${{ github.event.head_commit.message }}
- name: Set up Python 3.12
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install uv
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install cryptography scratchattach
- name: Generate and mask Vercel secrets
id: generate_vars
env:
FERNET_KEY: ${{ secrets.FERNET_KEY }}
run: |
cd tests
# Extract secrets securely
vercel_token_val=$(python -m util vercel | sed -n '1p')
org_id_val=$(python -m util vercel | sed -n '2p')
project_id_val=$(python -m util vercel | sed -n '3p')
# Mask values so they never appear in logs
echo "::add-mask::$vercel_token_val"
echo "::add-mask::$org_id_val"
echo "::add-mask::$project_id_val"
# Store them as environment variables (scoped to this job)
echo "vercel_token=$vercel_token_val" >> $GITHUB_ENV
echo "org_id=$org_id_val" >> $GITHUB_ENV
echo "project_id=$project_id_val" >> $GITHUB_ENV
cd ..
shell: bash
- name: Checkout website branch
uses: actions/checkout@v6
with:
ref: 'website'
- uses: nexterias/actions-vercel@v2
id: vercel
with:
token: ${{ env.vercel_token }}
org-id: ${{ env.org_id }}
project-id: ${{ env.project_id }}
production: true
prebuilt: true