Skip to content

Commit

Permalink
Add manual-build workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
ktlim committed Oct 24, 2023
1 parent 4bb31c1 commit fa56dfe
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/build-manually.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build Embargo Butler ingest container on demand
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

0 comments on commit fa56dfe

Please sign in to comment.