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.
All checks were successful
build-and-upload-docker / build-and-upload (release) Successful in 1m6s
All checks were successful
build-and-upload-docker / build-and-upload (release) Successful in 1m6s
This commit is contained in:
parent
7f02ea62b3
commit
046831b905
@ -1,13 +1,8 @@
|
|||||||
name: build-and-upload-docker
|
name: build-and-upload-docker
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
release:
|
||||||
branches:
|
types: [published]
|
||||||
- trunk
|
|
||||||
paths:
|
|
||||||
- 'Dockerfile'
|
|
||||||
- 'rootfs/**'
|
|
||||||
- 'build.sh'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-upload:
|
build-and-upload:
|
||||||
@ -25,7 +20,17 @@ jobs:
|
|||||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
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
|
- name: Build and push
|
||||||
run: |
|
run: |
|
||||||
chmod +x ./build.sh
|
chmod +x ./build-and-push.sh
|
||||||
./build.sh
|
./build-and-push.sh "${{ steps.get_version.outputs.release_tag }}"
|
||||||
@ -1,2 +1,2 @@
|
|||||||
FROM gitea/act_runner:latest
|
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