Skip to content

Build Rubin Portal Image #9

Build Rubin Portal Image

Build Rubin Portal Image #9

Workflow file for this run

name: Build Rubin Portal Image
on:
workflow_dispatch:
inputs:
git_tag:
description: "Git tag to use(e.g. 'portal-xxxx.x.x' or a full git tag)"
required: true
type: string
img_tag:
description: "Optional: Docker image tag(e.g. 'xxxx.x.x'); If omitted, `git_tag` will be used."
required: false
type: string
push_image:
description: "Push image to GHCR"
required: false
default: false
type: boolean
release:
types: [published]
permissions:
contents: read
packages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout firefly local actions
uses: actions/checkout@v4
with:
repository: Caltech-IPAC/firefly
ref: dev
path: firefly-actions
sparse-checkout: .github/actions
fetch-depth: 1
# ------------------------------------------------------------
# Checkout suit (this repo)
# ------------------------------------------------------------
- name: Checkout suit
uses: actions/checkout@v4
with:
ref: ${{ inputs.git_tag || github.event.release.tag_name }}
path: suit
# ------------------------------------------------------------
# Extract firefly tag from suit/config/app.config
# ------------------------------------------------------------
- name: Resolve Firefly version
id: firefly_version
uses: ./firefly-actions/.github/actions/firefly-version
with:
config_path: ./suit/config/app.config
# ------------------------------------------------------------
# Checkout firefly repo at configured tag
# ------------------------------------------------------------
- name: Checkout firefly
uses: actions/checkout@v4
with:
repository: Caltech-IPAC/firefly
ref: ${{ steps.firefly_version.outputs.ref }}
path: firefly
# -------------------------------------------------------------
# Use local action to resolve git ref and image tag from inputs
# -------------------------------------------------------------
- name: Resolve tags
id: resolve_tags
uses: ./firefly-actions/.github/actions/resolve-tags
with:
git_tag: ${{ inputs.git_tag }}
img_tag: ${{ inputs.img_tag }}
# ------------------------------------------------------------
# Checkout Portal online help
# ------------------------------------------------------------
- name: Checkout Portal online help
uses: actions/checkout@v4
with:
repository: lsst/suit-help
ref: master
path: suit-help
# ------------------------------------------------------------
# Setup Docker multi-platform build
# ------------------------------------------------------------
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# ------------------------------------------------------------
# Login to GHCR (only if pushing)
# ------------------------------------------------------------
- name: Login to GHCR
if: github.event_name == 'release' || inputs.push_image
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# ------------------------------------------------------------
# Build (and optionally push) multi-platform image
# ------------------------------------------------------------
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
file: firefly/docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name == 'release' || inputs.push_image }}
tags: ghcr.io/${{ github.repository }}:${{ steps.resolve_tags.outputs.tag }}
build-args: |
env=ops
build_dir=suit
target=-Psso.auth.required=false :suit:warAll
cache-from: type=gha
cache-to: type=gha,mode=max