Skip to content

Commit

Permalink
Add docker build for banzai and push to ghcr
Browse files Browse the repository at this point in the history
  • Loading branch information
mgdaily committed Oct 11, 2023
1 parent e24107f commit 101fad3
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Docker Image

concurrency: ${{ github.workflow }}-${{ github.ref }}

on:
push:
branches:
- "*"
tags:
- "*"
pull_request:
branches:
- master

jobs:
build-push:

runs-on: ubuntu-latest

permissions:
contents: write
packages: write

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

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

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

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

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

- name: Build and also push Dockerimage (only build on PRs)
id: build-and-push
uses: docker/build-push-action@v3
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 101fad3

Please sign in to comment.