mirror of https://github.com/pixelfed/pixelfed
Add github workflow to build containers to ghcr.io
Builds arm64 and amd64 containers and stores those into ghcr.io registry. Builds dev and staging branches and tagspull/6654/head
parent
0f781cba34
commit
9e005045fb
@ -0,0 +1,52 @@
|
||||
name: Container building for ghcr.io
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["dev", "staging"]
|
||||
tags:
|
||||
- v*
|
||||
|
||||
jobs:
|
||||
build:
|
||||
uses: docker/github-builder/.github/workflows/build.yml@v1
|
||||
permissions:
|
||||
contents: read # for checkout
|
||||
packages: write # to upload build to GHCR
|
||||
id-token: write # signing attestations with github oidc token
|
||||
with:
|
||||
output: image
|
||||
push: true
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
cache: true
|
||||
cache-mode: max
|
||||
fail-fast: true
|
||||
sbom: true
|
||||
sign: false
|
||||
cache-scope: pixelfed
|
||||
meta-images: ghcr.io/${{ github.repository_owner }}/pixelfed
|
||||
meta-tags: |
|
||||
type=semver,pattern=v{{version}}
|
||||
type=ref,event=branch
|
||||
meta-flavor: |
|
||||
latest=${{ startsWith(github.ref, 'refs/tags/') }}
|
||||
set-meta-labels: true
|
||||
set-meta-annotations: true
|
||||
secrets:
|
||||
registry-auths: |
|
||||
- registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
cleanup:
|
||||
needs: build
|
||||
if: ${{ github.ref_type == 'branch' }}
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- uses: dataaxiom/ghcr-cleanup-action@v1
|
||||
with:
|
||||
package: pixelfed
|
||||
delete-untagged: true
|
||||
older-than: 1 hour
|
||||
Loading…
Reference in New Issue