Skip to content

Commit 21d482e

Browse files
chore(deps): update from template
1 parent 3a0ca3e commit 21d482e

4 files changed

Lines changed: 51 additions & 16 deletions

File tree

.copier-answers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
_commit: v0.8.12
1+
_commit: v0.8.13
22
_src_path: gh:helmut-hoffer-von-ankershoffen/oe-python-template
33
attestations_enabled: true
44
author_email: helmuthva@gmail.com
Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
name: Vercel Preview Deployment
1+
name: Vercel Deploy on Push or Pull Request
22
on:
33
push:
4-
branches-ignore:
5-
- main
4+
branches:
5+
- "**"
6+
pull_request:
7+
types: [opened, synchronize, reopened]
68
jobs:
7-
Deploy-Preview:
9+
deploy-preview:
10+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
811
runs-on: ubuntu-latest
912
steps:
1013
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -16,20 +19,33 @@ jobs:
1619
enable-cache: true
1720
cache-dependency-glob: uv.lock
1821

22+
- name: Install Vercel CLI
23+
run: npm install --global vercel@latest
24+
1925
- name: Make Vercel distribution
2026
run: |
2127
make dist_vercel
2228
23-
- name: Install Vercel CLI
24-
run: npm install --global vercel@latest
25-
2629
- name: Deploy to Vercel
30+
id: deploy-vercel
2731
uses: helmut-hoffer-von-ankershoffen/vercel-deploy@6b4d15b80083745c218b5b8203077d5dd2de9f98
2832
with:
2933
GITHUB_DEPLOYMENT_ENV: Preview
34+
PRODUCTION: false
3035
WORKING_DIRECTORY: dist_vercel
3136
ARCHIVE: true
3237
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
3338
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
3439
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
3540
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
41+
42+
- name: Smoke Test of Vercel Deployment
43+
run: |
44+
response=$(curl -s -m 5 -H "x-vercel-protection-bypass: ${{ secrets.VERCEL_AUTOMATION_BYPASS_SECRET }}" ${{ steps.deploy-vercel.outputs.PREVIEW_URL }}/api/v2/hello-world)
45+
echo "API Response: $response"
46+
if [[ "$response" == *"Hello, world!"* ]]; then
47+
echo "✅ API response contains 'Hello, world!' as expected"
48+
else
49+
echo "❌ API response does not contain 'Hello, world!'"
50+
exit 1
51+
fi
Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: Vercel Production Deployment
1+
name: Vercel Deploy on Release
22
on:
3-
push:
4-
branches:
5-
- main
3+
release:
4+
types: [created]
65
jobs:
7-
Deploy-Production:
6+
deploy-production:
7+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -16,20 +16,33 @@ jobs:
1616
enable-cache: true
1717
cache-dependency-glob: uv.lock
1818

19+
- name: Install Vercel CLI
20+
run: npm install --global vercel@latest
21+
1922
- name: Make Vercel distribution
2023
run: |
2124
make dist_vercel
2225
23-
- name: Install Vercel CLI
24-
run: npm install --global vercel@latest
25-
2626
- name: Deploy to Vercel
27+
id: deploy-vercel
2728
uses: helmut-hoffer-von-ankershoffen/vercel-deploy@6b4d15b80083745c218b5b8203077d5dd2de9f98
2829
with:
2930
GITHUB_DEPLOYMENT_ENV: Production
31+
PRODUCTION: true
3032
WORKING_DIRECTORY: dist_vercel
3133
ARCHIVE: true
3234
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
3335
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
3436
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
3537
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
38+
39+
- name: Smoke Test of Vercel Deployment
40+
run: |
41+
response=$(curl -s -m 5 ${{ steps.deploy-vercel.outputs.DEPLOYMENT_UNIQUE_URL }}/api/v2/hello-world)
42+
echo "API Response: $response"
43+
if [[ "$response" == *"Hello, world!"* ]]; then
44+
echo "✅ API response contains 'Hello, world!' as expected"
45+
else
46+
echo "❌ API response does not contain 'Hello, world!'"
47+
exit 1
48+
fi

VERCEL.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,11 @@ of `projectId` from the previous command
6969
Pull Requests (Read and Write) permissions scoped for repository of the project. Copy the token in your buffer
7070
7. [Create secret](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/settings/secrets/actions/new) called `GH_PATH` with the value
7171
set to the token created in step 6
72+
8. Enable [Protection Bypass for
73+
Automation](https://vercel.com/docs/deployment-protection/methods-to-bypass-deployment-protection/protection-bypass-automation)
74+
in the Vercel dashboard of your project, and copy the created secret into your buffer.
75+
7. [Create secret](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/settings/secrets/actions/new) called
76+
`VERCEL_AUTOMATION_BYPASS_SECRET` with the value
77+
set to the secret created in step 7. This is to allow the smoke test to access preview deployments.
7278

7379
That's it. The rest is automatic, deploy happening on build of main.

0 commit comments

Comments
 (0)