Skip to content

Commit

Permalink
actions: build and push docker
Browse files Browse the repository at this point in the history
  • Loading branch information
icyphox committed Oct 6, 2024
1 parent 7b90e8e commit ad3e8f6
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: build and push docker image

on:
push:
branches: [master]
tags: ["*"]

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

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write

steps:
- name: Check out code
uses: actions/checkout@v4

- name: Copy Dockerfile to .
run: cp ./contrib/Dockerfile ./Dockerfile

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

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true
build-args: |
BUILDKIT_INLINE_CACHE=1

0 comments on commit ad3e8f6

Please sign in to comment.