Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 30 additions & 21 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,28 +116,37 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Download image
uses: actions/download-artifact@v4
with:
name: ${{ inputs.tag }}

- name: Load image
run: docker load -i "${{ inputs.tag }}.tar"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Push image to GitHub registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com \
-u ${{ github.actor }} --password-stdin
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

github_tag=docker.pkg.github.com/${{ inputs.image }}/${{ inputs.tag }}
docker tag "${{ inputs.image }}:${{ inputs.tag }}" $github_tag
docker push "$github_tag"
docker logout docker.pkg.github.com
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: docker.pkg.github.com
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push images to Docker Hub registry
run: |
echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login \
-u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}

docker push "${{ inputs.image }}:${{ inputs.tag }}"
docker logout
- name: Build and push multi-arch images
uses: docker/build-push-action@v5
with:
context: .
file: ${{ inputs.containerfile }}
platforms: linux/amd64,linux/arm64,linux/arm/v7
pull: true
push: true
tags: |
docker.pkg.github.com/${{ inputs.image }}/${{ inputs.tag }}
${{ inputs.image }}:${{ inputs.tag }}
labels: |
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.created=${{ github.event.repository.updated_at }}