forgejo-actions/.github/workflows/build.yml
Tamipes 2fce25f4cd
Some checks failed
Build and Push docker image / buildAndPush (push) Failing after 1m49s
feat: when building on actions use the builtin skopeo
2026-05-29 16:24:18 +02:00

26 lines
849 B
YAML

name: Build and Push docker image
on:
workflow_dispatch:
workflow_call:
push:
branches:
- main
jobs:
buildAndPush:
runs-on: [ nix ]
steps:
- uses: actions/checkout@v4
- name: Nix build
run: nix build --extra-experimental-features "flakes nix-command" .
- name: Setup skopeo
run: curl -o /etc/containers/policy.json --create-dirs https://raw.githubusercontent.com/containers/skopeo/refs/heads/main/default-policy.json
- name: Push Image
run: |
alias skp='skopeo copy --dest-password "$UPLOAD_TOKEN" --dest-username "$USERNAME" "docker-archive://$(realpath result)"'
skp "docker://$IMG_URL:$(date --iso-8601)" && \
skp "docker://$IMG_URL"
env:
USERNAME: tamipes
UPLOAD_TOKEN: ${{ secrets.UPLOAD_TOKEN }}
IMG_URL: git.tami.moe/tamipes/nix