-
-
Notifications
You must be signed in to change notification settings - Fork 202
54 lines (45 loc) · 1.46 KB
/
ci.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
name: ci
on:
push:
branches:
- master
pull_request:
jobs:
build:
if: (!contains(github.event.head_commit.message, 'ci(release)'))
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- if: (!github.event.pull_request)
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PERSONAL_TOKEN }}
fetch-depth: 0
- if: github.event.pull_request
uses: actions/checkout@v4
- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ~/.cache # Default cache directory for both Yarn and Cypress
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: yarn --immutable
- name: Run CI scripts
run: yarn ci
- name: Publish to NPM
if: github.ref == 'refs/heads/master'
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
git reset --hard
git config --global user.name ${{ secrets.GIT_USER }}
git config --global user.email ${{ secrets.GIT_EMAIL }}
npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
bash scripts/default-registry.sh