-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (47 loc) · 1.49 KB
/
deploy-preview.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
on:
pull_request:
types: [opened, synchronize]
workflow_dispatch:
jobs:
deploy:
name: Deploy preview
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Rust cache
uses: Swatinem/rust-cache@v1
with:
working-directory: wasm
- name: Install node.js
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
cache-dependency-path: 'svelte-app/yarn.lock'
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Install node.js dependencies
working-directory: svelte-app
run: yarn install --frozen-lockfile
- name: Build (Rust)
run: wasm-pack -v build wasm --target web
- name: Build (Svelte)
working-directory: svelte-app
run: |
echo -e "${{ github.sha }}\n$(date)" > static/version.txt && \
yarn build
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v1.2
with:
github-token: ${{ SECRETS.GITHUB_TOKEN }}
publish-dir: svelte-app/build
alias: deploy-preview-${{ github.event.number }}
env:
NETLIFY_AUTH_TOKEN: ${{ SECRETS.NETLIFY_TOKEN }}
NETLIFY_SITE_ID: ${{ SECRETS.NETLIFY_SITE_ID }}