-
Notifications
You must be signed in to change notification settings - Fork 43
90 lines (78 loc) · 2.61 KB
/
release-dashboard.yml
File metadata and controls
90 lines (78 loc) · 2.61 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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