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

This commit is contained in:
rebecca 2025-11-04 11:58:10 -03:00
parent 7f02ea62b3
commit 046831b905
2 changed files with 18 additions and 13 deletions

View File

@ -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:
@ -15,17 +10,27 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
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 }}"

View File

@ -1,2 +1,2 @@
FROM gitea/act_runner:latest
RUN apk add --no-cache nodejs npm
RUN apk add --no-cache nodejs npm docker