Skip to content

Commit

Permalink
Add docker build (#295)
Browse files Browse the repository at this point in the history
  • Loading branch information
tjaartvdwalt authored Aug 18, 2023
1 parent 937f8ad commit e15f335
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Docker build
on:
push:
branches:
- master
release:
types: [published]

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

- name: Set Image tag
run: |
if [[ "${{ github.ref_name }}" == "master" ]]; then
echo "TAG=latest" >> "$GITHUB_ENV"
else
echo "TAG=${{ github.ref_name }}" >> "$GITHUB_ENV"
fi
- 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
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}

- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile.latest
platforms: linux/amd64,linux/arm64
push: true
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:${{ env.TAG }}
cache-to: type=inline
tags: ghcr.io/${{ github.repository }}:${{ env.TAG }}

0 comments on commit e15f335

Please sign in to comment.