Build #69
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: Build | |
on: | |
workflow_dispatch: | |
inputs: | |
img_tag: | |
description: Docker Image Tag | |
ref: | |
description: Revision or Branch to build | |
default: main | |
push_latest: | |
description: Set True if the build is for the latest version | |
type: boolean | |
required: false | |
default: false | |
platforms: | |
description: Platforms to build for | |
type: choice | |
default: linux/amd64,linux/arm64 | |
options: | |
- linux/amd64,linux/arm64 | |
- linux/amd64 | |
- linux/arm64 | |
jobs: | |
build-image: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Set Inputs | |
id: set_inputs | |
run: | | |
if [ "${{ github.event_name }}" == "workflow_run" ]; then | |
echo "ref=${{ github.sha }}" >> $GITHUB_ENV | |
echo "push_latest=true" >> $GITHUB_ENV | |
else | |
# workflow_dispatch or other trigger | |
echo "ref=${{ github.event.inputs.ref }}" >> $GITHUB_ENV | |
echo "push_latest=${{ github.event.inputs.push_latest }}" >> $GITHUB_ENV | |
echo "img_tag=${{ github.event.inputs.img_tag }}" >> $GITHUB_ENV | |
fi | |
- name: Build Image | |
uses: hathitrust/github_actions/build@action-updates | |
with: | |
image: ghcr.io/${{ github.repository }} | |
dockerfile: Dockerfile | |
img_tag: ${{ github.event.inputs.img_tag }} | |
tag: ${{ env.ref }} | |
push_latest: ${{ env.push_latest}} | |
registry_token: ${{ github.token }} |