devops: trigger build-and-push on release publish; extract release tag; pass it to build-and-push.sh; add docker to the dockerfile for cli availability.
This commit is contained in:
parent
7f02ea62b3
commit
fd3bb28fab
@ -1,13 +1,8 @@
|
||||
name: build-and-upload-docker
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- trunk
|
||||
paths:
|
||||
- 'Dockerfile'
|
||||
- 'rootfs/**'
|
||||
- 'build.sh'
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
build-and-upload:
|
||||
@ -25,7 +20,17 @@ jobs:
|
||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||
|
||||
- name: Parse release version
|
||||
id: get_version
|
||||
run: |
|
||||
# Remove 'refs/tags/' if present, fallback to GITHUB_REF_NAME if possible
|
||||
ref="${GITHUB_REF#refs/tags/}"
|
||||
if [ -z "$ref" ]; then
|
||||
ref="${GITHUB_REF_NAME:-}"
|
||||
fi
|
||||
echo "release_tag=$ref" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Build and push
|
||||
run: |
|
||||
chmod +x ./build.sh
|
||||
./build.sh
|
||||
chmod +x ./build-and-push.sh
|
||||
./build-and-push.sh "${{ steps.get_version.outputs.release_tag }}"
|
||||
@ -1,2 +1,2 @@
|
||||
FROM gitea/act_runner:latest
|
||||
RUN apk add --no-cache nodejs npm
|
||||
RUN apk add --no-cache nodejs npm docker
|
||||
Loading…
x
Reference in New Issue
Block a user