-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (49 loc) · 1.64 KB
/
build-manually.yaml
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
46
47
48
49
50
51
52
53
54
55
56
name: On-demand ingest build
on:
workflow_dispatch:
inputs:
rubinenvVersion:
description: 'rubin-env version'
required: true
default: '7.0.1'
obsLsstVersion:
description: 'Science Pipelines release'
required: true
default: 'w_2023_41'
env:
INGEST_NAME: embargo-butler-ingest
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build ingest image
run: |
docker build . \
-f Dockerfile.ingest \
--tag $INGEST_NAME \
--label "runnumber=${GITHUB_RUN_ID}" \
--build-arg "RUBINENV_VERSION=${{ inputs.rubinenvVersion }}" \
--build-arg "OBS_LSST_VERSION=${{ inputs.obsLsstVersion }}"
- name: Log in to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Push image
run: |
INGEST_ID=ghcr.io/${{ github.repository_owner }}/$INGEST_NAME
if [[ "${{ github.ref }}" == "refs/pull/"* ]]; then
VERSION=$(echo "${{ github.head_ref }}" | sed -e 's|.*/||')
elif [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
VERSION=$(echo "${{ github.ref_name }}" | sed -e 's|^v||')
else
VERSION=latest
fi
INGEST_VERSION="${VERSION}-${{ inputs.obsLsstVersion }}"
echo INGEST_ID=$INGEST_ID
echo VERSION=$VERSION
echo INGEST_VERSION=$INGEST_VERSION
docker tag $INGEST_NAME $INGEST_ID:$INGEST_VERSION
docker push $INGEST_ID:$INGEST_VERSION