Skip to content

Release v2.0.4

Release v2.0.4 #12

Workflow file for this run

name: Push-Image
on:
push:
branches: [main]
tags:
- v*
# Allows to run this workflow manually from the Actions tab
workflow_dispatch:
env:
IMAGE_NAME: healthznerbot
jobs:
# test:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# # Get current package.json Version
# - name: Get current package version
# id: package-version
# uses: martinbeentjes/npm-get-version-action@v1.1.0
# - name: Build Docker Image
# id: build-image
# run: docker build -t ${{ secrets.DOCKER_IMAGE }}:${{ steps.package-version.outputs.current-version}} .
push:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v3
# Get current package.json Version
- name: Get current package version
id: package-version
uses: martinbeentjes/npm-get-version-action@v1.3.1
- name: Build Docker Image
id: build-image
run: docker build --tag ghcr.io/${{ github.repository_owner }}/${{ secrets.DOCKER_IMAGE }}:${{ steps.package-version.outputs.current-version}} --label "runnumber=${GITHUB_RUN_ID}" .
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Push image (version)
run: docker push ghcr.io/${{ github.repository_owner }}/${{ secrets.DOCKER_IMAGE }}:${{ steps.package-version.outputs.current-version}}
- name: Tag and push image (latest)
run: |
# Tag and push docker latest image
docker tag ghcr.io/${{ github.repository_owner }}/${{ secrets.DOCKER_IMAGE }}:${{ steps.package-version.outputs.current-version}} ghcr.io/${{ github.repository_owner }}/${{ secrets.DOCKER_IMAGE }}:latest
docker push ghcr.io/${{ github.repository_owner }}/${{ secrets.DOCKER_IMAGE }}:latest