Build a -glr
variant for use with gitlab-runner-cloudgov.
#1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker | |
on: | |
pull_request: | |
branches: [ "main" ] | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: gsa-tts/trestle | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
# This is used to complete the identity challenge | |
# with sigstore/fulcio when running outside of PRs. | |
id-token: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# Set up BuildKit Docker container builder to be able to build | |
# multi-platform images and export cache | |
# https://github.com/docker/setup-buildx-action | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 | |
- name: Extract Docker metadata | |
id: meta | |
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
flavor: latest=true | |
# Build Docker image with Buildx | |
# https://github.com/docker/build-push-action | |
- name: Build and push Docker image | |
id: build | |
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0 | |
with: | |
context: . | |
push: false | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
outputs: type=docker,dest=/tmp/myimage.tar | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: trestle-base-img | |
path: /tmp/myimage.tar | |
build-glr: | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
# This is used to complete the identity challenge | |
# with sigstore/fulcio when running outside of PRs. | |
id-token: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: trestle-base-img | |
path: /tmp | |
- name: Load image | |
run: | | |
docker load --input /tmp/myimage.tar | |
docker image ls -a | |
# Set up BuildKit Docker container builder to be able to build | |
# multi-platform images and export cache | |
# https://github.com/docker/setup-buildx-action | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 | |
- name: Extract Docker metadata - glr variant | |
id: meta-glr | |
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
flavor: latest=false | |
tags: | | |
type=raw,value=latest-glr | |
- name: Build and push Docker image - glr variant | |
id: build-glr | |
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0 | |
with: | |
context: . | |
file: Dockerfile.glr | |
build-args: BASE_VERSION=latest | |
push: false | |
tags: ${{ steps.meta-glr.outputs.tags }} | |
labels: ${{ steps.meta-glr.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |