Create and publish Keycloak maintenance page #5
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: Create and publish Keycloak maintenance page | |
on: workflow_dispatch | |
env: | |
GITHUB_REGISTRY: ghcr.io | |
IMAGE_NAME: bcgov/sso-maintenance | |
jobs: | |
build-and-push-image: | |
runs-on: ubuntu-20.04 | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Log in to the GitHub Container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.GITHUB_REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Cache Docker layers | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/.buildx-mt-cache | |
key: ${{ runner.os }}-buildx-mt-${{ github.sha }} | |
restore-keys: ${{ runner.os }}-buildx-mt- | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v3 | |
with: | |
context: docker/maintenance-page | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=local,src=/tmp/.buildx-mt-cache | |
cache-to: type=local,dest=/tmp/.buildx-mt-cache-new | |
- name: Move cache | |
run: | | |
rm -rf /tmp/.buildx-mt-cache | |
mv /tmp/.buildx-mt-cache-new /tmp/.buildx-mt-cache |