-
-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (38 loc) · 2.38 KB
/
Copy pathrun-example-deployment.yml
File metadata and controls
43 lines (38 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
name: 'GitHub Action deploy example'
on:
pull_request:
push:
branches:
- '*'
jobs:
run-example-deployment:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
# Extracts GitHub metadata (branch name, etc.)
- name: Expose GitHub slug/short variables # See https://github.com/rlespinasse/github-slug-action#exposed-github-environment-variables
uses: rlespinasse/github-slug-action@v4.4.0 # See https://github.com/rlespinasse/github-slug-action
- uses: ./
with:
# Deploys examples/static-deployment
command: "yarn deploy:example --token ${{ secrets.VERCEL_TOKEN }}"
applyDomainAliases: true
failIfAliasNotLinked: false
# Uses dynamically resolved additional aliases (e.g: one based on the current branch's name)
# Uses alias that's longer than 63 chars to check if it gets shortened, because of RFC 1035 - See https://vercel.com/support/articles/why-is-my-vercel-deployment-url-being-shortened?query=url%20length#rfc-1035
# github-action-deploy-on-vercel-example-extra-alias-test-limit-alias-length.vercel.app > github-action-deploy-on-vercel-example-extra-alias-test-limit-a.vercel.app (shortened)
# TODO Don't always use GITHUB_REF_SLUG (push) but GITHUB_HEAD_REF_SLUG when event is pull_request - See https://github.com/rlespinasse/github-slug-action/issues/71
extraAliases: >-
github-action-deploy-on-vercel-example-${{ env.GITHUB_REF_SLUG }}.vercel.app,
github-action-deploy-on-vercel-example-extra-alias.vercel.app,
github-action-deploy-on-vercel-example-extra-alias-test-limit-alias-length.vercel.app
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
# TODO Add anti-regression tests to check all aliases have been deployed correctly!
- run: "echo \"Found deployment url: ${{ env.VERCEL_DEPLOYMENT_URL }}\""
- run: "echo \"Created ${{ env.VERCEL_ALIASES_CREATED_COUNT }} aliases\""
- run: "echo \"Created aliases: ${{ env.VERCEL_ALIASES_CREATED }}\""
- run: "echo \"Created aliases (full): ${{ env.VERCEL_ALIASES_CREATED_FULL }}\""
- run: "echo \"Alias markdown generated: ${{ env.VERCEL_ALIASES_CREATED_URLS_MD }}\""
- run: "echo \"Failed ${{ env.VERCEL_ALIASES_FAILED_COUNT }} aliases\""
- run: "echo \"Failed aliases (full): ${{ env.VERCEL_ALIASES_FAILED_FULL }}\""