Build Docker Image #8
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 Docker Image | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log into ghcr.io registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ghcr.io/ietf-tools/keycloak:24.0.3-ietf.${{ github.run_number }}, ghcr.io/ietf-tools/keycloak:latest | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
# - name: Delete old images | |
# uses: snok/container-retention-policy@v2 | |
# with: | |
# image-names: keycloak | |
# cut-off: One week ago UTC | |
# keep-at-least: 3 | |
# account-type: org | |
# org-name: ietf-tools | |
# token: ${{ secrets.GITHUB_TOKEN }} | |
# token-type: github-token |