Skip to content

Merge pull request #5 from OpenCHAMI/synackd/build-fixes #14

Merge pull request #5 from OpenCHAMI/synackd/build-fixes

Merge pull request #5 from OpenCHAMI/synackd/build-fixes #14

Workflow file for this run

name: Build and Publish Docker Image
on:
push:
branches:
- main
paths:
- 'dockerfiles/dnf/Dockerfile'
tags:
- 'v*.*.*'
pull_request:
branches:
- main
paths:
- 'dockerfiles/dnf/Dockerfile'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract version from tag
if: startsWith(github.ref, 'refs/tags/')
id: extract_version
run: echo "::set-output name=version::${GITHUB_REF#refs/tags/}"
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
file: dockerfiles/dnf/Dockerfile
push: true
tags: |
ghcr.io/openchami/image-build:latest