Skip to content

Build Container and Push to GitHub Container Registry #33

Build Container and Push to GitHub Container Registry

Build Container and Push to GitHub Container Registry #33

Workflow file for this run

name: Build Container and Push to GitHub Container Registry
on:
push:
branches:
- 'main'
tags:
- '*'
paths-ignore:
- '**.md'
- '.github/**'
- 'LICENSE'
pull_request:
branches:
- 'main'
paths-ignore:
- '**.md'
- '.github/**'
- 'LICENSE'
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- 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: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le,linux/s390x
push: true
tags: |
ghcr.io/buildsociety/${{ github.event.repository.name }}:latest
ghcr.io/buildsociety/${{ github.event.repository.name }}:${{ github.sha }}
annotations: |
org.opencontainers.image.title=${{ github.repository }}
org.opencontainers.image.description=A container from Build Society - ${{ github.repository }}
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.created=${{ github.event.head_commit.timestamp }}
no-cache: true
provenance: true
sbom: true