20250114 #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image Release | |
on: | |
release: | |
types: [published] | |
env: | |
IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/bivac | |
DOCKER_CLI_EXPERIMENTAL: enabled | |
jobs: | |
push_to_registry: | |
name: Push Docker images to Docker Hub | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.event.release.tag_name }} | |
- name: Login to Github Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.CR_PAT }} | |
- name: Build and push docker images | |
run: | | |
IMAGE_NAME=${{ env.IMAGE_NAME }} IMAGE_VERSION=${{ github.event.release.tag_name }} KEEP_IMAGES=yes make docker-images | |
- uses: actions-ecosystem/action-regex-match@v2 | |
id: regex-match | |
with: | |
text: ${{ github.event.release.tag_name }} | |
regex: '^([0-9]+).([0-9]+).[0-9]+$' | |
- name: Move tags and push to Github Registry | |
if: ${{ steps.regex-match.outputs.match != '' }} | |
run: | | |
docker manifest create ${{ env.IMAGE_NAME }}:${{ steps.regex-match.outputs.group1 }}.${{ steps.regex-match.outputs.group2 }} \ | |
${{ env.IMAGE_NAME }}-linux-amd64:${{ github.event.release.tag_name }} \ | |
${{ env.IMAGE_NAME }}-linux-386:${{ github.event.release.tag_name }} \ | |
${{ env.IMAGE_NAME }}-linux-arm:${{ github.event.release.tag_name }} | |
docker manifest annotate ${{ env.IMAGE_NAME }}:${{ steps.regex-match.outputs.group1 }}.${{ steps.regex-match.outputs.group2 }} \ | |
${{ env.IMAGE_NAME }}-linux-amd64:${{ github.event.release.tag_name }} --os linux --arch amd64 | |
docker manifest annotate ${{ env.IMAGE_NAME }}:${{ steps.regex-match.outputs.group1 }}.${{ steps.regex-match.outputs.group2 }} \ | |
${{ env.IMAGE_NAME }}-linux-386:${{ github.event.release.tag_name }} --os linux --arch 386 | |
docker manifest annotate ${{ env.IMAGE_NAME }}:${{ steps.regex-match.outputs.group1 }}.${{ steps.regex-match.outputs.group2 }} \ | |
${{ env.IMAGE_NAME }}-linux-arm:${{ github.event.release.tag_name }} --os linux --arch arm | |
docker manifest push ${{ env.IMAGE_NAME }}:${{ steps.regex-match.outputs.group1 }}.${{ steps.regex-match.outputs.group2 }} | |
docker manifest create ${{ env.IMAGE_NAME }}:${{ steps.regex-match.outputs.group1 }} \ | |
${{ env.IMAGE_NAME }}-linux-amd64:${{ github.event.release.tag_name }} \ | |
${{ env.IMAGE_NAME }}-linux-386:${{ github.event.release.tag_name }} \ | |
${{ env.IMAGE_NAME }}-linux-arm:${{ github.event.release.tag_name }} | |
docker manifest annotate ${{ env.IMAGE_NAME }}:${{ steps.regex-match.outputs.group1 }} \ | |
${{ env.IMAGE_NAME }}-linux-amd64:${{ github.event.release.tag_name }} --os linux --arch amd64 | |
docker manifest annotate ${{ env.IMAGE_NAME }}:${{ steps.regex-match.outputs.group1 }} \ | |
${{ env.IMAGE_NAME }}-linux-386:${{ github.event.release.tag_name }} --os linux --arch 386 | |
docker manifest annotate ${{ env.IMAGE_NAME }}:${{ steps.regex-match.outputs.group1 }} \ | |
${{ env.IMAGE_NAME }}-linux-arm:${{ github.event.release.tag_name }} --os linux --arch arm | |
docker manifest push ${{ env.IMAGE_NAME }}:${{ steps.regex-match.outputs.group1 }} |