Merging the develop branch into the main branch (v3.8.0) #30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Docker | |
on: | |
push: | |
branches: [ "main" ] | |
env: | |
IMAGE: zkbob-console | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: 'npm' | |
- name: Read node from package.json | |
id: package-version | |
uses: martinbeentjes/npm-get-version-action@main | |
- name: Show node version number | |
run: echo "Version is ${{ steps.package-version.outputs.current-version }}" | |
- name: Installing dependecies | |
uses: borales/[email protected] | |
with: | |
cmd: install | |
- name: Compile production version | |
uses: borales/[email protected] | |
with: | |
cmd: build:prod | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Build and push Docker container | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: ./Dockerfile.prod | |
push: true | |
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.IMAGE }}:${{ steps.package-version.outputs.current-version }}, ${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.IMAGE }}:latest | |
- name: Create tag | |
uses: rickstaa/action-create-tag@v1 | |
with: | |
tag: ${{ steps.package-version.outputs.current-version }} | |
message: "" |