refactor: split Docker publish into separate workflow
Docker images now build only after release is published, not during the draft creation phase. This prevents users from getting updates before the release is reviewed and approved.
This commit is contained in:
parent
7fd49fb54a
commit
ea9a9e3a08
2 changed files with 124 additions and 110 deletions
114
.github/workflows/create-release.yml
vendored
114
.github/workflows/create-release.yml
vendored
|
|
@ -205,113 +205,10 @@ jobs:
|
|||
working-directory: tests/integration
|
||||
run: docker-compose -f docker-compose.test.yml down -v || true
|
||||
|
||||
build_docker_images:
|
||||
needs:
|
||||
- extract_version
|
||||
- version_guard
|
||||
- preflight_tests
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
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: .
|
||||
target: runtime
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
provenance: false
|
||||
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/pulse:buildcache
|
||||
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/pulse:buildcache,mode=max
|
||||
tags: |
|
||||
rcourtman/pulse:${{ needs.extract_version.outputs.tag }}
|
||||
rcourtman/pulse:${{ needs.extract_version.outputs.version }}
|
||||
rcourtman/pulse:latest
|
||||
ghcr.io/${{ github.repository_owner }}/pulse:${{ needs.extract_version.outputs.tag }}
|
||||
ghcr.io/${{ github.repository_owner }}/pulse:${{ needs.extract_version.outputs.version }}
|
||||
ghcr.io/${{ github.repository_owner }}/pulse:latest
|
||||
labels: |
|
||||
org.opencontainers.image.title=Pulse
|
||||
org.opencontainers.image.description=Proxmox monitoring system
|
||||
org.opencontainers.image.version=${{ needs.extract_version.outputs.tag }}
|
||||
org.opencontainers.image.created=${{ github.event.repository.updated_at }}
|
||||
org.opencontainers.image.revision=${{ github.sha }}
|
||||
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
|
||||
org.opencontainers.image.url=${{ github.server_url }}/${{ github.repository }}
|
||||
org.opencontainers.image.licenses=MIT
|
||||
|
||||
- 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
|
||||
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/pulse-docker-agent:buildcache
|
||||
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/pulse-docker-agent:buildcache,mode=max
|
||||
tags: |
|
||||
rcourtman/pulse-docker-agent:${{ needs.extract_version.outputs.tag }}
|
||||
rcourtman/pulse-docker-agent:${{ needs.extract_version.outputs.version }}
|
||||
rcourtman/pulse-docker-agent:latest
|
||||
ghcr.io/${{ github.repository_owner }}/pulse-docker-agent:${{ needs.extract_version.outputs.tag }}
|
||||
ghcr.io/${{ github.repository_owner }}/pulse-docker-agent:${{ needs.extract_version.outputs.version }}
|
||||
ghcr.io/${{ github.repository_owner }}/pulse-docker-agent:latest
|
||||
labels: |
|
||||
org.opencontainers.image.title=Pulse Docker Agent
|
||||
org.opencontainers.image.description=Docker container monitoring agent for Pulse
|
||||
org.opencontainers.image.version=${{ needs.extract_version.outputs.tag }}
|
||||
org.opencontainers.image.created=${{ github.event.repository.updated_at }}
|
||||
org.opencontainers.image.revision=${{ github.sha }}
|
||||
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
|
||||
org.opencontainers.image.url=${{ github.server_url }}/${{ github.repository }}
|
||||
org.opencontainers.image.licenses=MIT
|
||||
|
||||
- name: Output Docker image information
|
||||
run: |
|
||||
echo "✅ Docker images built and pushed successfully!"
|
||||
echo ""
|
||||
echo "Server images:"
|
||||
echo " - rcourtman/pulse:${{ needs.extract_version.outputs.tag }}"
|
||||
echo " - rcourtman/pulse:${{ needs.extract_version.outputs.version }}"
|
||||
echo " - rcourtman/pulse:latest"
|
||||
echo ""
|
||||
echo "Agent images:"
|
||||
echo " - rcourtman/pulse-docker-agent:${{ needs.extract_version.outputs.tag }}"
|
||||
echo " - rcourtman/pulse-docker-agent:${{ needs.extract_version.outputs.version }}"
|
||||
echo " - rcourtman/pulse-docker-agent:latest"
|
||||
|
||||
create_release:
|
||||
needs:
|
||||
- extract_version
|
||||
- build_docker_images
|
||||
- preflight_tests
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
permissions:
|
||||
|
|
@ -494,12 +391,9 @@ jobs:
|
|||
echo "⚠️ IMPORTANT: This release is in DRAFT status"
|
||||
echo ""
|
||||
echo "Next steps:"
|
||||
echo "1. Review the automatically generated release notes"
|
||||
echo "2. Edit and categorize changes as needed"
|
||||
echo "3. Publish the release when ready"
|
||||
echo ""
|
||||
echo "All artifacts have been uploaded."
|
||||
echo "Docker images are available at Docker Hub and GHCR."
|
||||
echo "1. Review the release notes at the URL above"
|
||||
echo "2. Publish the release when ready"
|
||||
echo "3. Docker images will be built automatically after publish"
|
||||
echo ""
|
||||
|
||||
validate_release_assets:
|
||||
|
|
|
|||
120
.github/workflows/publish-docker.yml
vendored
Normal file
120
.github/workflows/publish-docker.yml
vendored
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
name: Publish Docker Images
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
concurrency:
|
||||
group: docker-publish-${{ github.event.release.tag_name }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Extract version from release tag
|
||||
id: version
|
||||
run: |
|
||||
TAG="${{ github.event.release.tag_name }}"
|
||||
VERSION="${TAG#v}"
|
||||
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||
echo "Publishing Docker images for ${TAG}"
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.release.tag_name }}
|
||||
|
||||
- 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: .
|
||||
target: runtime
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
provenance: false
|
||||
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/pulse:buildcache
|
||||
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/pulse:buildcache,mode=max
|
||||
tags: |
|
||||
rcourtman/pulse:${{ steps.version.outputs.tag }}
|
||||
rcourtman/pulse:${{ steps.version.outputs.version }}
|
||||
rcourtman/pulse:latest
|
||||
ghcr.io/${{ github.repository_owner }}/pulse:${{ steps.version.outputs.tag }}
|
||||
ghcr.io/${{ github.repository_owner }}/pulse:${{ steps.version.outputs.version }}
|
||||
ghcr.io/${{ github.repository_owner }}/pulse:latest
|
||||
labels: |
|
||||
org.opencontainers.image.title=Pulse
|
||||
org.opencontainers.image.description=Proxmox monitoring system
|
||||
org.opencontainers.image.version=${{ steps.version.outputs.tag }}
|
||||
org.opencontainers.image.created=${{ github.event.release.published_at }}
|
||||
org.opencontainers.image.revision=${{ github.sha }}
|
||||
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
|
||||
org.opencontainers.image.url=${{ github.server_url }}/${{ github.repository }}
|
||||
org.opencontainers.image.licenses=MIT
|
||||
|
||||
- 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
|
||||
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/pulse-docker-agent:buildcache
|
||||
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/pulse-docker-agent:buildcache,mode=max
|
||||
tags: |
|
||||
rcourtman/pulse-docker-agent:${{ steps.version.outputs.tag }}
|
||||
rcourtman/pulse-docker-agent:${{ steps.version.outputs.version }}
|
||||
rcourtman/pulse-docker-agent:latest
|
||||
ghcr.io/${{ github.repository_owner }}/pulse-docker-agent:${{ steps.version.outputs.tag }}
|
||||
ghcr.io/${{ github.repository_owner }}/pulse-docker-agent:${{ steps.version.outputs.version }}
|
||||
ghcr.io/${{ github.repository_owner }}/pulse-docker-agent:latest
|
||||
labels: |
|
||||
org.opencontainers.image.title=Pulse Docker Agent
|
||||
org.opencontainers.image.description=Docker container monitoring agent for Pulse
|
||||
org.opencontainers.image.version=${{ steps.version.outputs.tag }}
|
||||
org.opencontainers.image.created=${{ github.event.release.published_at }}
|
||||
org.opencontainers.image.revision=${{ github.sha }}
|
||||
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
|
||||
org.opencontainers.image.url=${{ github.server_url }}/${{ github.repository }}
|
||||
org.opencontainers.image.licenses=MIT
|
||||
|
||||
- name: Output image information
|
||||
run: |
|
||||
echo "✅ Docker images published successfully!"
|
||||
echo ""
|
||||
echo "Server images:"
|
||||
echo " - rcourtman/pulse:${{ steps.version.outputs.tag }}"
|
||||
echo " - rcourtman/pulse:${{ steps.version.outputs.version }}"
|
||||
echo " - rcourtman/pulse:latest"
|
||||
echo ""
|
||||
echo "Agent images:"
|
||||
echo " - rcourtman/pulse-docker-agent:${{ steps.version.outputs.tag }}"
|
||||
echo " - rcourtman/pulse-docker-agent:${{ steps.version.outputs.version }}"
|
||||
echo " - rcourtman/pulse-docker-agent:latest"
|
||||
Loading…
Reference in a new issue