add forgejo actions workflow for container building
Some checks failed
Build Container / Build Container (push) Failing after 5s
Some checks failed
Build Container / Build Container (push) Failing after 5s
This commit is contained in:
parent
6ce5984c1e
commit
e6331781cb
1 changed files with 36 additions and 0 deletions
36
.forgejo/workflows/container.yml
Normal file
36
.forgejo/workflows/container.yml
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
name: Build Container
|
||||||
|
|
||||||
|
on:
|
||||||
|
push: {}
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-container:
|
||||||
|
name: Build Container
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: ghcr.io/osscontainertools/kaniko:alpine
|
||||||
|
steps:
|
||||||
|
- name: Install NodeJS for actions compatibility
|
||||||
|
run: apk add --no-cache nodejs
|
||||||
|
- name: Checkout source code
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
- name: Login to container registry (prod only)
|
||||||
|
if: ${{ forgejo.ref_name == 'main' }}
|
||||||
|
run: /kaniko/executor login --username="forgejo-actions" --password="${{ forgejo.token }}"
|
||||||
|
- name: Build Container
|
||||||
|
env:
|
||||||
|
KANIKO_NO_PUSH: ${{ forgejo.ref_name != 'main' }}
|
||||||
|
run: /kaniko/executor
|
||||||
|
--dockerfile="${{forgejo.workspace }}/Containerfile"
|
||||||
|
--context="dir://${{ forgejo.workspace }}"
|
||||||
|
--destination=git.hamburg.ccc.de/ccchh/dooris:latest
|
||||||
|
--credential-helpers=env
|
||||||
|
--no-push-cache
|
||||||
|
--annotation=org.opencontainers.image.ref.name=dooris
|
||||||
|
--annotation=org.opencontainers.image.url=${{ forgejo.server_url }}/${{ forgejo.repository }}
|
||||||
|
--annotation=org.opencontainers.image.source=${{ forgejo.server_url }}/${{ forgejo.repository }}
|
||||||
|
--annotation=org.opencontainers.image.licenses=AGPL-3.0
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue