-
Notifications
You must be signed in to change notification settings - Fork 37
87 lines (74 loc) · 2.28 KB
/
deploy.yaml
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
86
87
name: deploy
on:
pull_request:
types: [opened, synchronize, edited, reopened]
push:
branches:
- main
workflow_dispatch:
jobs:
run:
name: Deploy
runs-on: "ubuntu-latest"
permissions:
contents: write
issues: write
pull-requests: write
statuses: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install Asciinema
run: |
python3 -m pip install asciinema
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
cache-dependency-path: cmd/nbe/go.sum
- name: Test nbe
run: |
go test -v -race ./cmd/nbe
- name: Build nbe
run: |
go install ./cmd/nbe
- name: Generate recordings
shell: 'script -q -e -c "bash {0}"'
run: |
nbe generate recording --exit-on-error
- name: Auto-commit generated recordings
uses: stefanzweifel/git-auto-commit-action@v5
if: ${{ github.ref_name == 'main' }}
with:
commit_message: Auto-commit recording
file_pattern: examples/**/output.txt examples/**/output.cast
- name: Build HTML
run: |
nbe build
- name: Vercel preview deploy
uses: amondnet/vercel-action@v25
if: ${{ github.ref_name != 'main' }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
scope: ${{ secrets.VERCEL_TEAM_SCOPE }}
working-directory: ./html
- name: Vercel production deploy
uses: amondnet/vercel-action@v25
if: ${{ github.ref_name == 'main' }}
with:
vercel-args: "--prod"
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
scope: ${{ secrets.VERCEL_TEAM_SCOPE }}
working-directory: ./html