-
Notifications
You must be signed in to change notification settings - Fork 62
44 lines (36 loc) · 1.2 KB
/
main.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
name: CI
on:
push:
branches:
- master
jobs:
publish:
name: 📦 Publish npm package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
registry-url: 'https://registry.npmjs.org'
- run: yarn install
- run: yarn lint
- run: yarn build
- run: yarn publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
docker-publish:
name: 📦️ Publish docker image
runs-on: ubuntu-latest
needs: publish
steps:
- uses: actions/checkout@v2
- name: docker login
env:
DOCKER_USER: ${{secrets.DOCKER_USER}}
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
run: docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- name: build image
run: docker build . --file Dockerfile -t ${{secrets.DOCKER_USER}}/tatum-kms:latest -t "${{secrets.DOCKER_USER}}/tatum-kms:$(cat ./package.json | jq -r ".version")"
- name: push image
run: docker push ${{secrets.DOCKER_USER}}/tatum-kms:latest && docker push ${{secrets.DOCKER_USER}}/tatum-kms:$(cat ./package.json | jq -r ".version")