Skip to content

Commit

Permalink
ci: set up docker publishing to GHCR
Browse files Browse the repository at this point in the history
  • Loading branch information
galargh committed Sep 29, 2023
1 parent ae4eb17 commit f39d0ff
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish docker images

on:
push:
branches:
- master
pull_request:
workflow_dispatch:
inputs:
push:
description: 'Push to registry'
required: false
default: 'false'

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

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

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: ${{ github.event_name == 'push' || github.event.inputs.push == 'true' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit f39d0ff

Please sign in to comment.