Skip to content

Commit

Permalink
dev: ci: build Docker images
Browse files Browse the repository at this point in the history
Uses the existing in-tree Dockerfile to build Docker images when
a release is made and everytime there is a merge to master.
Publishes the images to the GitHub Container Registry as well.
Heavily based on https://docs.docker.com/build/ci/github-actions/examples/
  • Loading branch information
cardoe committed Feb 10, 2023
1 parent 0a052c7 commit 18958bf
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Docker images

on:
push:
branches:
- build-docker
- master
tags:
- '*.*.*'

permissions:
contents: read
packages: write

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=edge
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and Push
uses: docker/build-push-action@v4
with:
contest: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 18958bf

Please sign in to comment.