-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (85 loc) · 2.9 KB
/
repl.yml
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 REPL
on:
workflow_call:
inputs:
environment:
description: 'The environment to deploy REPL'
required: true
type: string
alias-domains:
description: 'A list of domains used for the REPL deploymnet'
required: false
type: string
secrets:
REPL_VERCEL_TOKEN:
required: true
REPL_VERCEL_ORG_ID:
required: true
REPL_VERCEL_PROJECT_ID:
required: true
jobs:
# Deployment steps taken from https://github.com/colinwilson/static-site-to-vercel/blob/master/.github/workflows/deploy-preview.yml
repl_build:
name: Build REPL
if: false
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: yarn
node-version: 20
- uses: ./.github/actions/rust-toolchain
with:
targets: wasm32-unknown-unknown
- name: Install wasm-opt
run: |
curl -L -O https://github.com/WebAssembly/binaryen/releases/download/version_116/binaryen-version_116-x86_64-linux.tar.gz
tar -xf binaryen-version_116-x86_64-linux.tar.gz
echo "$PWD/binaryen-version_116/bin" >> $GITHUB_PATH
- uses: Swatinem/rust-cache@v2
with:
key: wasm
- name: Bump max inotify watches
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p;
- run: yarn --frozen-lockfile
- name: Build native packages
run: yarn build-native-release
- run: yarn build
- run: yarn build-native-wasm
- run: yarn workspace @atlaspack/repl build
- name: Start Deployment
uses: bobheadxi/deployments@v1
id: deployment
with:
step: start
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.head_ref }}
env: ${{ inputs.environment }}
override: false
- name: Deploy to Vercel
uses: amondnet/vercel-action@v25
id: vercel-action
with:
alias-domains: ${{ inputs.alias_domains }}
github-comment: false
scope: atlaspack
vercel-args: ${{ inputs.environment == 'Production' && '--prod' || '' }}
vercel-org-id: ${{ secrets.REPL_VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.REPL_VERCEL_PROJECT_ID }}
vercel-token: ${{ secrets.REPL_VERCEL_TOKEN }}
working-directory: packages/dev/repl
- name: Update Deployment Status
uses: bobheadxi/deployments@v1
if: always()
with:
step: finish
token: ${{ secrets.GITHUB_TOKEN }}
env: ${{ inputs.environment }}
override: false
status: ${{ job.status }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
env_url: ${{ steps.vercel-action.outputs.preview-url }}