This repository has been archived by the owner on Jul 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (53 loc) · 1.73 KB
/
publish-packages.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: docker & npm builds
on:
push:
branches: [master]
jobs:
image-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set Version
run: echo "VERSION=$(cat ./castleblock-service/package.json | grep '"version"' | head -n 1 | awk '{print $2}' | sed 's/"//g; s/,//g')" >> $GITHUB_ENV
- name: Print Version
run: echo $VERSION
- name: Publish Image
uses: matootie/github-docker@v3.1.0
with:
accessToken: ${{ github.token }}
context: ./castleblock-service/
contextName: Dockerfile
containerRegistry: true
tag: |
latest
${{ env.VERSION }}
- name: Print Image URL
run: echo ${{ steps.publish.outputs.imageURL }}
npm-publish:
name: npm-publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- name: Check version changes
uses: EndBug/version-check@v1
id: check
with:
file-name: ./castleblock-cli/package.json
file-url: https://unpkg.com/castleblock/package.json
diff-search: true
assume-same-version: old
static-checking: localIsNew
- name: Publish to npmjs.com
if: steps.check.outputs.changed == 'true'
run: npm publish ./castleblock-cli/
env:
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
- name: Publish to github
if: steps.check.outputs.changed == 'true'
run: npm publish --registry=https://npm.pkg.github.com ./castleblock-cli/
env:
NODE_AUTH_TOKEN: ${{ github.token }}