runners/.forgejo/workflows/build.yml
Chris Kruining 8f8319ed66
Some checks failed
Create OCI image(s) / Build and push images (push) Failing after 1m51s
lets try this
2025-09-08 11:02:01 +02:00

48 lines
1.2 KiB
YAML

name: Create OCI image(s)
on:
workflow_dispatch:
push:
branches:
- main
env:
registry: git.amarth.cloud
owner: amarth
image: default
tag: latest
jobs:
build:
name: Build and push images
runs-on: default
steps:
- name: Install nodejs
run: nix-env -iA nixpkgs.nodejs
- uses: actions/checkout@v4
- name: Prepare podman
run: |
# configure container policy to accept insecure registry
nix-env -iA nixpkgs.podman nixpkgs.kvmtool
# configure container policy to accept insecure registry
mkdir -p ~/.config/containers
echo '{ "default": [ {"type":"insecureAcceptAnything"} ] }' > ~/.config/containers/policy.json
- name: Log into registry
run: |
podman login --username "${{ forge.actor }}" --password "${{ forge.token }}" ${{ env.registry }}
- name: Create image
run: |
nix-build src/default.nix
podman load < result
- name: Push image
run: >-
podman push
--creds="${{ forge.actor }}:${{ secrets.PACKAGE_TOKEN }}"
localhost/default:latest
${{ env.registry }}/${{ env.owner }}/${{ env.image }}:${{ env.tag }}