Skip to content

Commit

Permalink
Merge pull request #18 from rtuszik/multiarch
Browse files Browse the repository at this point in the history
ci: update docker build for multi arch
  • Loading branch information
rtuszik authored Dec 28, 2024
2 parents 8041446 + 496419f commit 4ba0b8b
Showing 1 changed file with 44 additions and 43 deletions.
87 changes: 44 additions & 43 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,54 @@
name: Build and Publish Docker Image

on:
workflow_dispatch:
inputs:
release_tag:
description: "Release version to build"
required: true
revision:
description: "Revision number (optional)"
required: false
workflow_dispatch:
inputs:
release_tag:
description: "Release version to build"
required: true
revision:
description: "Revision number (optional)"
required: false

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Determine tag
id: determine_tag
run: |
revision="${{ github.event.inputs.revision }}"
if [ "$revision" ]; then
echo "RELEASE_TAG=${{ github.event.inputs.release_tag }}-rev.$revision" >> "$GITHUB_ENV"
else
echo "RELEASE_TAG=${{ github.event.inputs.release_tag }}" >> "$GITHUB_ENV"
fi
echo "PHOTON_VERSION=${{ github.event.inputs.release_tag }}" >> "$GITHUB_ENV"
- name: Determine tag
id: determine_tag
run: |
revision="${{ github.event.inputs.revision }}"
if [ "$revision" ]; then
echo "RELEASE_TAG=${{ github.event.inputs.release_tag }}-rev.$revision" >> "$GITHUB_ENV"
else
echo "RELEASE_TAG=${{ github.event.inputs.release_tag }}" >> "$GITHUB_ENV"
fi
echo "PHOTON_VERSION=${{ github.event.inputs.release_tag }}" >> "$GITHUB_ENV"
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
build-args: |
PHOTON_VERSION=${{ env.PHOTON_VERSION }}
push: true
tags: |
rtuszik/photon-docker:${{ env.RELEASE_TAG }}
rtuszik/photon-docker:latest
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
build-args: |
PHOTON_VERSION=${{ env.PHOTON_VERSION }}
push: true
tags: |
rtuszik/photon-docker:${{ env.RELEASE_TAG }}
rtuszik/photon-docker:latest
platforms: linux/amd64,linux/arm64

- name: Store the latest release
run: echo ${{ env.RELEASE_TAG }} > .last_release
if: success()
continue-on-error: false
- name: Store the latest release
run: echo ${{ env.RELEASE_TAG }} > .last_release
if: success()
continue-on-error: false

0 comments on commit 4ba0b8b

Please sign in to comment.