Add .forgejo/workflows/container.yaml
Signed-off-by: xengi <forgejo@xengi.de>
This commit is contained in:
parent
cf9bd15593
commit
47d6a58b18
1 changed files with 38 additions and 0 deletions
38
.forgejo/workflows/container.yaml
Normal file
38
.forgejo/workflows/container.yaml
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
name: Build archlinux-aur container
|
||||
|
||||
on:
|
||||
push:
|
||||
schedule:
|
||||
- cron: '0 12 * * *'
|
||||
timezone: Europe/Berlin
|
||||
workflow_dispatch:
|
||||
|
||||
enable-email-notifications: true
|
||||
|
||||
env:
|
||||
BUILDKITD_FLAGS: --oci-worker-no-process-sandbox
|
||||
REGISTRY_URL: coderberg.org
|
||||
REGISTRY_IMAGE: ${{ env.REGISTRY_URL }}/${{ env.FORGEJO_REPOSITORY }}/archlinux-aur
|
||||
REGISTRY_TAG: latest
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: buildkit
|
||||
name: Build archlinux-aur container
|
||||
steps:
|
||||
- name: Check out the repository
|
||||
run: git clone ${{ env.FORGEJO_SERVER_URL }}/${{ env.FORGEJO_REPOSITORY }} .
|
||||
- name: Setup buildkit
|
||||
run: |
|
||||
mkdir -p ~/.docker
|
||||
echo "{\"auths\":{\"${{ env.REGISTRY_URL }}\":{\"username\":\"${{ env.FORGEJO_REPOSITORY_OWNER }}\",\"password\":\"${{ env.FORGEJO_TOKEN }}\"}}}" > ~/.docker/config.json
|
||||
- name: Build container
|
||||
run: |
|
||||
export CREATED=$(date -Iseconds)
|
||||
sed -i "s/%%CREATED%%/$CREATED/" docker/Dockerfile
|
||||
sed -i "s/%%COMMIT%%/$CI_BUILD_REF_NAME/" docker/Dockerfile
|
||||
buildctl-daemonless.sh build \
|
||||
--frontend dockerfile.v0 \
|
||||
--local context=docker/ \
|
||||
--local dockerfile=docker/ \
|
||||
--output type=image,name=${{ env.REGISTRY_IMAGE }}:${{ env.REGISTRY_TAG }},push=true
|
||||
Loading…
Reference in a new issue