Skip to content

Release Dashboard Image #4

Release Dashboard Image

Release Dashboard Image #4

name: Release Dashboard Image
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: 'Release version (e.g., 1.2.3 or v1.2.3)'
required: true
type: string
env:
GHCR_REGISTRY: ghcr.io
DOCKER_REGISTRY: docker.io
IMAGE_NAME: exosphere-dashboard
SHA_TAG: ${{ github.sha }}
RELEASE_VERSION: ${{ github.event.inputs.version || github.ref_name }}
jobs:
publish-image:
runs-on: ubuntu-latest
if: github.repository == 'exospherehost/exospherehost'
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.GHCR_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Parse version
id: version
run: |
VERSION="${{ env.RELEASE_VERSION }}"
# Remove 'v' or 'V' prefix if present
if [[ $VERSION =~ ^[vV] ]]; then
VERSION="${VERSION#?}"
fi
# Extract major, minor, patch
IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "major=$MAJOR" >> $GITHUB_OUTPUT
echo "minor=$MINOR" >> $GITHUB_OUTPUT
echo "major_minor=$MAJOR.$MINOR" >> $GITHUB_OUTPUT
- name: Generate tags & labels
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.GHCR_REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
${{ env.DOCKER_REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
type=raw,value=${{ steps.version.outputs.version }}
type=raw,value=${{ steps.version.outputs.major_minor }}
type=raw,value=${{ steps.version.outputs.major }}
type=sha,format=short
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./dashboard
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
provenance: true
sbom: true