Skip to content

Add GitHub workflow to build container image #1

Add GitHub workflow to build container image

Add GitHub workflow to build container image #1

name: localshowd
on:
push:
branches:
- main
jobs:
container-image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository_owner }}/localshowd
flavor: |
latest=${{ github.ref == 'refs/heads/main' }}
tags: |
type=sha
- name: Build and push
uses: docker/build-push-action@v4
with:
platforms: linux/amd64, linux/arm64, linux/arm/v7
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
context: .
pull: true
push: ${{ github.event_name != 'pull_request' }}