Skip to content

Commit

Permalink
chore: add image build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tchardin committed May 7, 2024
1 parent 7a19fba commit 860f19c
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Create and publish the docker images to github registry

on:
push:
pull_request:
branches:
- main

env:
REGISTRY: ghcr.io

jobs:
build-image:
runs-on: ubuntu-latest


permissions:
contents: read
packages: write


steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit 860f19c

Please sign in to comment.