Skip to content

Update build.yaml

Update build.yaml #1

Workflow file for this run

name: build
on:
push:
branches:
- main
tags:
- v*
pull_request:
jobs:
push-ghcr:
name: Build and push image
runs-on: ubuntu-22.04
permissions:
packages: write
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: docker/[email protected]
id: meta
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=sha,format=long
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build image
id: build
uses: redhat-actions/buildah-build@v2
with:
layers: true
containerfiles: |
./Dockerfile
image: jail
tags: ${{ steps.meta.outputs.tags }}
- name: Push to ghcr
if: ${{ github.event_name == 'push' }}
uses: redhat-actions/push-to-registry@v2
id: push
with:
image: ${{ steps.build.outputs.image }}
tags: ${{ steps.build.outputs.tags }}
registry: ghcr.io/${{ github.repository_owner }}
username: ${{ github.actor }}
password: ${{ github.token }}