forked from cobrinhas/github-bookmark
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (46 loc) · 1.31 KB
/
publish-github.yaml
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
name: Publish to GitHub
on:
push:
branches:
- 'master'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up npm
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'
- name: Install npm
run: npm install --frozen-lockfile
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
publish: bash scripts/release.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Print outputs
uses: actions/github-script@v4
with:
script: |
JSON.stringify(${{ steps.changesets.outputs }}, null, "\t");
- name: Build project
id: build-project
run: npm run build
- name: Zip dist folder
id: zip-folder
if: steps.changesets.outputs.published == 'true' && steps.build-project.outcome == 'success'
uses: vimtor/action-zip@v1
with:
files: dist
dest: dist.zip
- name: After Zipping dist folder
if: steps.zip-folder.outcome == 'success'
uses: actions/upload-artifact@v1
with:
name: my-artifact
path: ${{ github.workspace }}/dist.zip