-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a75d060
commit d77fad7
Showing
2 changed files
with
62 additions
and
6 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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: image-build | ||
|
||
on: | ||
release: | ||
# Dynamic releasetag tag is set based on the assumption this ci task only runs on release | ||
types: [published] | ||
|
||
# Variables to be used throughout the workflow manifest | ||
env: | ||
# TO-DO (@phenixblue): Need to investigate more into why the `linux/ppc64le` | ||
# platform has issues with installing Python dependencies during image build. | ||
# | ||
# Removing for now to not block | ||
TARGET_PLATFORMS: linux/amd64,linux/arm64 | ||
jobs: | ||
|
||
# Build and push imageswap-init container image | ||
build-and-push-image: | ||
name: Build and push TWR Tools image to DockerHub | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Check out the repo | ||
uses: actions/checkout@v2 | ||
|
||
# Collect Release Tag is used to to collect information needed later in the action and expose it so it can be referenced | ||
- name: Collect Release Tag | ||
id: prep | ||
# GITHUB_REF variable must exist in action; this may rely on {{ on: release: types: [published] }} gating the action | ||
run: | | ||
echo ::set-output name=releasetag::${GITHUB_REF#refs/tags/} | ||
# Setup QEMU to support multi-arch builds | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
# Part of docker/build-push-action@v2; setting up the build system | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
# Part of docker/build-push-action@v2; login to dockerhub | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Build and push imageswap-init image to DockerHub | ||
if: github.repository == 'phenixblue/twrtools' | ||
timeout-minutes: 30 | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: ./ | ||
# file should be specified relative to the repo root rather than relative to the context | ||
file: ./Dockerfile | ||
# Defines the target platform architectures images should be built for | ||
platforms: ${{ env.TARGET_PLATFORMS }} | ||
# push is no longer defaulted to true under v2; to push you must specify push is true | ||
push: true | ||
# Uses the releasetag output exposed by the Collect Release Tag step to set the tag under v2 | ||
tags: jmsearcy/twrtools:${{ steps.prep.outputs.releasetag }},jmsearcy/twrtools:latest |
This file was deleted.
Oops, something went wrong.