build and publish containers #27
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build and publish containers | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- v* | |
permissions: | |
packages: write | |
contents: read | |
jobs: | |
build-dnsmasq: | |
runs-on: ubuntu-latest | |
steps: | |
- name: check out the repo | |
uses: actions/checkout@v4 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
# list of Docker images to use as base name for tags | |
images: | | |
ghcr.io/openchami/dnsmasq | |
# generate Docker tags based on the following events/attributes | |
tags: | | |
type=schedule | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern=v{{version}} | |
type=semver,pattern=v{{major}}.{{minor}} | |
type=semver,pattern=v{{major}} | |
type=sha | |
- name: setup Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to github container repo | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push dnsmasq | |
uses: docker/build-push-action@v5 | |
with: | |
platforms: linux/amd64 | |
context: . | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Build and push dnsmasq-loader | |
uses: docker/build-push-action@v5 | |
with: | |
platforms: linux/amd64 | |
context: . | |
file: ./Dockerfile.loader | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: | | |
ghcr.io/openchami/dnsmasq-loader:latest | |
ghcr.io/openchami/dnsmasq-loader:${{ steps.meta.outputs.version }} | |
labels: ${{ steps.meta.outputs.labels }} |