Skip to content

Release Images

Release Images #36

Workflow file for this run

name: Release Images
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: "Version to release"
required: true
default: "change-me"
type: string
env:
# Base the version and image tag on the release tag or user input
IMAGE_TAG: ${{ github.event.release.tag_name || github.event.inputs.version }}
VERSION: ${{ github.event.release.tag_name || github.event.inputs.version }}
IMAGE_REG: ghcr.io
IMAGE_NAME: benc-uk/nanomon
permissions:
packages: write
jobs:
image-build:
name: Build and push images
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set BUILD_INFO with date
run: |
echo BUILD_INFO="Stable build $(date --rfc-3339=seconds)" >> ${GITHUB_ENV}
- run: |
echo ===== RELEASE ======
echo VERSION: $VERSION
echo IMAGE_TAG: $IMAGE_TAG
echo BUILD_INFO: $BUILD_INFO
- name: Install just
uses: taiki-e/install-action@just
- name: Build & push images - semver tagged
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u USERNAME --password-stdin
just images
just --yes push
- name: Build & push images - latest tagged
env:
IMAGE_TAG: latest
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u USERNAME --password-stdin
just images
just --yes push