-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from rtuszik/multiarch
ci: update docker build for multi arch
- Loading branch information
Showing
1 changed file
with
44 additions
and
43 deletions.
There are no files selected for viewing
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
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 |