Skip to content

feat: add automated container build #108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 42 additions & 4 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,52 @@ name: Docker Image CI

on: [push, pull_request]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:

docker-build:

runs-on: ubuntu-latest

permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build the Docker image
run: docker build . --file Dockerfile --tag spellcheck:$(date +%s)

- name: Set up QEMU
uses: docker/[email protected]
with:
image: tonistiigi/binfmt:qemu-v6.2.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
install: true

- name: Login to GitHub Registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Metadata for the image
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}

- name: Build container
uses: docker/[email protected]
with:
platforms: "linux/amd64, linux/arm64"
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}