Add Docker image building to release workflow

Release workflow now builds and pushes Docker images after creating
the draft release:

- Pulse server image (linux/amd64, linux/arm64)
- Docker agent image (linux/amd64, linux/arm64)
- Pushed to both Docker Hub and GHCR
- Tagged with version and 'latest'

Requires DOCKER_USERNAME and DOCKER_PASSWORD secrets to be configured.
This commit is contained in:
rcourtman 2025-11-11 11:39:29 +00:00
parent 79ce68f8ce
commit 96817dd5e7

View file

@ -13,6 +13,8 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
tag: ${{ steps.create_release.outputs.tag }}
steps:
- name: Checkout repository
@ -148,3 +150,73 @@ jobs:
echo "All artifacts have been uploaded and validated."
echo "checksums.txt matches all uploaded binaries."
echo ""
build-docker-images:
needs: create-release
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Pulse server image
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
provenance: false
tags: |
rcourtman/pulse:latest
rcourtman/pulse:${{ needs.create-release.outputs.tag }}
ghcr.io/${{ github.repository_owner }}/pulse:latest
ghcr.io/${{ github.repository_owner }}/pulse:${{ needs.create-release.outputs.tag }}
- name: Build and push Docker agent image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
target: agent_runtime
platforms: linux/amd64,linux/arm64
push: true
provenance: false
tags: |
rcourtman/pulse-docker-agent:latest
rcourtman/pulse-docker-agent:${{ needs.create-release.outputs.tag }}
ghcr.io/${{ github.repository_owner }}/pulse-docker-agent:latest
ghcr.io/${{ github.repository_owner }}/pulse-docker-agent:${{ needs.create-release.outputs.tag }}
- name: Output Docker image information
run: |
echo "✅ Docker images built and pushed successfully!"
echo ""
echo "Server images:"
echo " - rcourtman/pulse:${{ needs.create-release.outputs.tag }}"
echo " - rcourtman/pulse:latest"
echo ""
echo "Agent images:"
echo " - rcourtman/pulse-docker-agent:${{ needs.create-release.outputs.tag }}"
echo " - rcourtman/pulse-docker-agent:latest"