-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (53 loc) · 1.69 KB
/
build.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
57
58
name: Build job container
on:
pull_request:
branches:
- 'main'
workflow_dispatch:
inputs:
stackTag:
description: 'Science Pipelines tag'
required: true
default: 'w_latest'
type: string
makeProd:
description: 'Push container with "prod" tag'
required: false
type: boolean
jobs:
build-image:
name: Build image for nightly reporting
runs-on: ubuntu-latest
env:
STACK_TAG: ${{ inputs.stackTag || 'w_latest' }}
IMAGE_ID: "ghcr.io/${{ github.repository_owner }}/nightly-reporting"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Determine the image tag
run: |
docker run "lsstsqre/centos:7-stack-lsst_distrib-$STACK_TAG" bash -c "cat conda/envs/lsst-scipipe-*/share/eups/ups_db/global.tags" > eups.tag
echo "eups tag = $(< eups.tag)"
echo "IMAGE_TAG=$(< eups.tag)" >> $GITHUB_ENV
- name: Tag as prod if selected
if: ${{ inputs.makeProd }}
run: |
echo "Tag this image as prod"
echo "IMAGE_TAG=prod" >> $GITHUB_ENV
- name: Build and push image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: "${{ env.IMAGE_ID }}:${{ env.IMAGE_TAG }}"
labels: |
"runnumber=${{ github.run_id }}"
"stacktag=${{ env.STACK_TAG }}"
build-args: |
STACK_TAG=${{ env.STACK_TAG }}