-
Notifications
You must be signed in to change notification settings - Fork 11
62 lines (57 loc) · 1.62 KB
/
deploy-staging.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
name: Staging deployment
# rebuild any PRs and main branch changes
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build: # make sure build/ci work properly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Cache pnpm modules
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: pnpm/[email protected]
with:
version: 7.12.2
run_install: true
- name: Use Node.js 16.x
uses: actions/[email protected]
with:
node-version: 16.x
cache: "pnpm"
- run: pnpm run package
- run: cp -r packages/bpp/dist dist
- run: cp action.yml dist/
- run: cp README.md dist/
- run: cp keys.schema.json dist/
- name: Deploy to staging
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
pnpm dlx gh-pages -d dist -b staging -u "Plasmo G.A.T Deployer <[email protected]>"
test: # make sure the action works on a clean machine without building
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
with:
ref: staging
- uses: ./
env:
NODE_ENV: "test"
with:
artifact: build/artifact.zip
keys: ${{ secrets.BPP_KEYS }}