-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (36 loc) · 1.45 KB
/
npmpublish.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
name: Publish Node.js Package
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.20.0
registry-url: https://registry.npmjs.org/
- name: Set up QEMU # https://github.com/docker/setup-qemu-action
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx # https://github.com/docker/setup-buildx-action
uses: docker/setup-buildx-action@v2
- name: Define tag
run: echo tag=`git describe --tags` >> $GITHUB_ENV
- name: Bump package version
run: |
git config --global user.email ${{ secrets.PUBLISH_EMAIL }}
git config --global user.name ${{ secrets.PUBLISH_USER_NAME }}
npm version ${{ env.tag }}
- name: Push new version to Github
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish package to NPM
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Login to Docker Hub
run: docker login -u mercos -p ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build Docker Image and Push to Docker Hub
run: docker buildx build --build-arg ROBOT_EYES_VERSION=${{ env.tag }} --push --platform=linux/amd64,linux/arm64 -t mercos/robot-eyes:${{ env.tag }} -t mercos/robot-eyes:latest .