-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (41 loc) · 1.22 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Build A Branch
on:
workflow_run:
workflows: ['Run Tests']
branches: ['main']
types: [completed]
workflow_dispatch:
inputs:
tag:
description: Release or Tag
required: true
push_latest:
description: Set True if the build is for the latest version
type: boolean
required: false
default: false
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 "tag=${{ github.sha }}" >> $GITHUB_ENV
echo "push_latest=true" >> $GITHUB_ENV
else
# workflow_dispatch or other trigger
echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
echo "push_latest=${{ github.event.inputs.push_latest }}" >> $GITHUB_ENV
fi
- name: Build Image
uses: hathitrust/github_actions/build@v1
with:
image: ghcr.io/${{ github.repository }}-unstable
tag: ${{ env.tag }}
push_latest: ${{ env.push_latest}}
registry_token: ${{ github.token }}