Skip to content

Commit 1e91bb7

Browse files
committed
add gha to deploy
1 parent f067a46 commit 1e91bb7

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/deploy-package.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Deploy
2+
concurrency:
3+
group: "pr-${{ github.event.pull_request.number }}"
4+
cancel-in-progress: true
5+
on:
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
config:
12+
runs-on: ubuntu-latest
13+
if: github.head_ref == 'main' || github.head_ref == 'master'
14+
steps:
15+
- name: checkout
16+
uses: actions/checkout@v2
17+
with:
18+
persist-credentials: false
19+
- uses: webfactory/ssh-agent@v0.5.3
20+
with:
21+
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
22+
- name: Set node version
23+
uses: actions/setup-node@v2
24+
with:
25+
node-version-file: .nvmrc
26+
cache: 'npm'
27+
cache-dependency-path: package-lock.json
28+
- name: Install node modules
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.PACKAGES_READ_TOKEN }}
31+
run: |
32+
echo "//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}" >> .npmrc
33+
git config --global url."https://${GITHUB_TOKEN}@github.com".insteadOf ssh://git@github.com
34+
npm ci --verbose
35+
- name: Cache multiple paths
36+
uses: actions/cache@v3
37+
with:
38+
path: |
39+
/tmp/webpack-cache
40+
/tmp/babel-cache
41+
key: ${{ runner.os }}-client-${{ github.ref_name }}-${{ hashFiles('client/webpack.prod.js') }}
42+
- name: compile
43+
env:
44+
BABEL_CACHE_PATH: /tmp/babel-cache
45+
run: |
46+
rm dist/*.js.map
47+
rm dist/*.js
48+
npx webpack
49+
- name: compile
50+
run: npm publish

0 commit comments

Comments
 (0)