-
Notifications
You must be signed in to change notification settings - Fork 19
43 lines (43 loc) · 1.31 KB
/
release.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
name: release
on:
push:
branches:
- main
jobs:
test:
uses: ./.github/workflows/test.yml
deploy:
runs-on: ubuntu-latest
needs: 'test'
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_TOKEN: ${{ secrets.GH_BRANCH_PROTECTION }} # needs to be an admin token to get around branch protection
GH_PR_TOKEN: ${{ secrets.GH_PR_TOKEN }}
steps:
- uses: actions/checkout@v2
# Yes, we really want to checkout the PR
with:
token: ${{ secrets.GH_BRANCH_PROTECTION }} # needs to be an admin token to get around branch protection
fetch-depth: "0"
- run: |
if [[ ! -z "${GH_PR_NUM}" ]]; then
echo "Checking out PR"
git fetch origin pull/$GH_PR_NUM/head:tmp
git checkout tmp
fi
- uses: actions/setup-node@v1
with:
node-version: '14'
- uses: actions/cache@v2
id: yarn-cache
name: Cache npm deps
with:
path: |
node_modules
**/node_modules
~/.cache/Cypress
key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
- run: yarn install --frozen-lockfile
if: steps.yarn-cache.outputs.cache-hit != 'true'
- run: yarn build
- run: .github/release.sh