Skip to content

Commit 9e4ed6c

Browse files
fix: use tags properly
1 parent 8f9a67e commit 9e4ed6c

File tree

2 files changed

+52
-1
lines changed

2 files changed

+52
-1
lines changed

.github/workflows/dev.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Dev Build
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
push:
7+
description: "Push to Docker Hub"
8+
type: boolean
9+
required: true
10+
default: true
11+
12+
jobs:
13+
dev:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v3
18+
19+
- name: Set up QEMU
20+
uses: docker/setup-qemu-action@v3
21+
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v3
24+
25+
- name: Login to Docker Hub
26+
if: inputs.push == true
27+
uses: docker/login-action@v3
28+
with:
29+
username: ${{ secrets.DOCKERHUB_USERNAME }}
30+
password: ${{ secrets.DOCKERHUB_TOKEN }}
31+
32+
- name: Build (and optionally push) dev images
33+
uses: docker/bake-action@v5
34+
with:
35+
push: ${{ inputs.push }}
36+
files: ./docker-bake.hcl
37+
targets: |
38+
devpush
39+
devpush5090
40+

.github/workflows/release.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,21 @@ jobs:
5252
VERSION="${{ github.event.inputs.version }}"
5353
echo "RELEASE_VERSION=${VERSION}" >> $GITHUB_ENV
5454
echo "IS_MANUAL_RELEASE=true" >> $GITHUB_ENV
55+
elif [[ "${{ github.event_name }}" == "release" ]]; then
56+
# GitHub Release published event
57+
VERSION="${{ github.event.release.tag_name }}"
58+
echo "RELEASE_VERSION=${VERSION}" >> $GITHUB_ENV
59+
echo "IS_MANUAL_RELEASE=false" >> $GITHUB_ENV
5560
else
5661
# Tag trigger: use tag name (remove refs/tags/ prefix)
5762
VERSION=${GITHUB_REF#refs/tags/}
5863
echo "RELEASE_VERSION=${VERSION}" >> $GITHUB_ENV
5964
echo "IS_MANUAL_RELEASE=false" >> $GITHUB_ENV
6065
fi
6166
67+
# Export TAG for docker-bake.hcl variable override
68+
echo "TAG=${RELEASE_VERSION}" >> $GITHUB_ENV
69+
6270
- name: Build and push the images to Docker Hub
6371
uses: docker/bake-action@v5
6472
with:
@@ -68,7 +76,10 @@ jobs:
6876
regular
6977
rtx5090
7078
set: |
71-
TAG=${{ env.RELEASE_VERSION }}
79+
regular.tags[0]="${{ env.IMAGE_REF }}:${{ env.RELEASE_VERSION }}"
80+
regular.tags[1]="${{ env.IMAGE_REF }}:latest"
81+
rtx5090.tags[0]="${{ env.IMAGE_REF }}:${{ env.RELEASE_VERSION }}-5090"
82+
rtx5090.tags[1]="${{ env.IMAGE_REF }}:latest-5090"
7283
7384
- name: Create GitHub Release
7485
uses: softprops/action-gh-release@v1

0 commit comments

Comments
 (0)