Skip to content

Download container from master branch #2

Download container from master branch

Download container from master branch #2

Workflow file for this run

name: Build container
on:
push:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
QEMU_PLATFORMS: "linux/amd64,linux/arm64"
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
tag: ["v2.0", "v2.1" ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ matrix.tag }}
fetch-depth: 0
- name: Extract metadata (tags, labels) for container
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=branch
type=sha,prefix=,format=short
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Log in to the container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
# Add support for more platforms with QEMU
name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: ${{ env.QEMU_PLATFORMS }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Download Dockerfile and install script
run: |
curl -sL https://raw.githubusercontent.com/unioslo/pg-iam/master/Dockerfile -o Dockerfile
curl -sL https://raw.githubusercontent.com/unioslo/pg-iam/master/install.sh -o install.sh
- name: Build and push container image
uses: docker/build-push-action@v5
with:
context: .
platforms: ${{ env.QEMU_PLATFORMS }}
file: "Dockerfile"
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}