Skip to content

Commit

Permalink
Update build.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
YurBoiRene authored Nov 18, 2023
1 parent cd28bf0 commit e61c4ce
Showing 1 changed file with 27 additions and 19 deletions.
46 changes: 27 additions & 19 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ on:
- v*
pull_request:
jobs:
build:
push-ghcr:
name: Build and push image
runs-on: ubuntu-22.04
permissions:
packages: write
id-token: write
contents: read
steps:
- uses: docker/[email protected]
with:
image: tonistiigi/binfmt:qemu-v6.2.0
platforms: arm64
- uses: docker/[email protected]
with:
driver-opts: image=moby/buildkit
- name: Checkout
uses: actions/checkout@v3

- uses: docker/[email protected]
id: meta
with:
Expand All @@ -26,17 +27,24 @@ jobs:
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- uses: docker/[email protected]
if: github.event_name != 'pull_request'
- 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:
registry: ghcr.io
image: ${{ steps.build.outputs.image }}
tags: ${{ steps.build.outputs.tags }}
registry: ghcr.io/${{ github.repository_owner }}
username: ${{ github.actor }}
password: ${{ github.token }}
- uses: docker/[email protected]
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64,linux/arm64
provenance: false
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit e61c4ce

Please sign in to comment.