Don't use metadata action for this run #3
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: 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: 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: ghcr.io/unioslo/pg-iam:${{ matrix.tag }} |