Skip to content

Commit 12fbf64

Browse files
authored
Aktualisieren von deploy-website.yml
1 parent 7f20fa7 commit 12fbf64

File tree

1 file changed

+30
-26
lines changed

1 file changed

+30
-26
lines changed

.github/workflows/deploy-website.yml

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -39,42 +39,46 @@ jobs:
3939
with:
4040
python-version: "3.12"
4141

42-
- name: Install Python deps
42+
- name: Install dependencies
4343
run: |
4444
python -m pip install --upgrade pip
4545
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
4646
pip install cryptography scratchattach
4747
48-
- name: Checkout website branch
49-
uses: actions/checkout@v4
50-
with:
51-
ref: 'website'
52-
53-
# New single-step secure deploy:
54-
- name: Generate Vercel token and deploy (keeps secrets in-step only)
48+
- name: Generate and mask Vercel secrets
49+
id: generate_vars
5550
env:
5651
FERNET_KEY: ${{ secrets.FERNET_KEY }}
5752
run: |
58-
set -euo pipefail
59-
60-
# run token generator and capture output into variables WITHOUT printing
61-
# Adjust this read pattern if `python -m util vercel` emits a different format.
6253
cd tests
63-
IFS=$'\n' read -r VERCEL_TOKEN ORG_ID PROJECT_ID < <(python -m util vercel)
64-
cd ..
54+
# Extract secrets securely
55+
vercel_token_val=$(python -m util vercel | sed -n '1p')
56+
org_id_val=$(python -m util vercel | sed -n '2p')
57+
project_id_val=$(python -m util vercel | sed -n '3p')
6558
66-
# Mask the values so accidental prints later are redacted
67-
echo "::add-mask::$VERCEL_TOKEN"
68-
echo "::add-mask::$ORG_ID"
69-
echo "::add-mask::$PROJECT_ID"
59+
# Mask values so they never appear in logs
60+
echo "::add-mask::$vercel_token_val"
61+
echo "::add-mask::$org_id_val"
62+
echo "::add-mask::$project_id_val"
7063
71-
# Install node / vercel CLI (no global logs of the token)
72-
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
73-
sudo apt-get install -y nodejs
74-
npm install -g vercel
64+
# Store them as environment variables (scoped to this job)
65+
echo "vercel_token=$vercel_token_val" >> $GITHUB_ENV
66+
echo "org_id=$org_id_val" >> $GITHUB_ENV
67+
echo "project_id=$project_id_val" >> $GITHUB_ENV
7568
76-
# Run Vercel deploy using the token only in this step (no exporting)
77-
# Use --confirm so it won't prompt; adapt flags for your project.
78-
cd website
79-
vercel --token "$VERCEL_TOKEN" --prod --confirm --org "$ORG_ID" --scope "$ORG_ID" --force --local-config ./vercel.json -- --project "$PROJECT_ID"
69+
cd ..
8070
shell: bash
71+
72+
- name: Checkout website branch
73+
uses: actions/checkout@v4
74+
with:
75+
ref: 'website'
76+
77+
- uses: nexterias/actions-vercel@v1
78+
id: vercel
79+
with:
80+
token: ${{ env.vercel_token }}
81+
org-id: ${{ env.org_id }}
82+
project-id: ${{ env.project_id }}
83+
production: true
84+
prebuilt: true

0 commit comments

Comments
 (0)