Skip to content

Bumped version to 0.1.11 in the openapi specs #44

Bumped version to 0.1.11 in the openapi specs

Bumped version to 0.1.11 in the openapi specs #44

name: Build a Docker image and push it to the GitHub container registry
on:
push:
branches: [ 'main' ]
tags: [ '*.*.*' ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
# https://github.com/actions/checkout
- name: Checkout repository
uses: actions/checkout@v3
# https://github.com/sigstore/cosign-installer
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@main
with:
cosign-release: 'v2.0.1'
# https://github.com/docker/setup-buildx-action
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v2
# https://github.com/docker/login-action
- name: Log into ghcr.io
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
# https://github.com/sigstore/cosign
- name: Sign the published Docker image
if: github.event_name != 'pull_request'
env:
COSIGN_EXPERIMENTAL: "true"
run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign -y {}@${{ steps.build-and-push.outputs.digest }}
# https://github.com/docker/login-action
- name: Log into Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta-docker
uses: docker/metadata-action@v4
with:
images: docker.io/${{ secrets.DOCKERHUB_IMAGE_NAME }}
# https://github.com/docker/build-push-action
- name: Build and push Docker image to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v2
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-docker.outputs.tags }}
labels: ${{ steps.meta-docker.outputs.labels }}