This repository has been archived on 2024-10-01. You can view files and clone it, but cannot push or open issues or pull requests.
container-images/.forgejo/workflows/blog-pim.yaml

25 lines
1.2 KiB
YAML
Raw Normal View History

2024-04-28 20:54:04 +00:00
on: [ push ]
jobs:
blog-pim:
runs-on: docker
container:
image: git.kun.is/home/forgejo-nix-action:687d16c49ea7936068bac64ec68c480a9d681962
steps:
- name: Clone repository
2024-04-28 21:26:06 +00:00
run: git clone ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git src
2024-04-28 20:54:04 +00:00
- name: Setup Nix cache
run: |
2024-04-28 21:26:06 +00:00
/bin/attic login local ${{ vars.ATTIC_URL }} ${{ secrets.ATTIC_TOKEN }}
/bin/attic use ${{ vars.ATTIC_CACHE }}
- name: Build image
2024-04-28 21:27:11 +00:00
run: nix build --out-link image ./src#packages.x86_64-linux.blog-pim
2024-04-28 21:26:06 +00:00
- name: Push image to Nix cache
run: /bin/attic push ${{ vars.ATTIC_CACHE }} image
2024-04-28 20:54:04 +00:00
- name: Log into container registry
2024-04-28 21:26:06 +00:00
run: /bin/skopeo login --tls-verify --username ${{ vars.RUNNER_USER }} --password ${{ secrets.RUNNER_TOKEN }} ${GITHUB_SERVER_URL}
- name: Push image to container registry
run: |
2024-04-28 21:26:06 +00:00
/bin/skopeo --insecure-policy copy docker-archive:image docker://${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}:latest
gitrev=$(git --git-dir src/.git --work-tree src rev-parse HEAD)
/bin/skopeo --insecure-policy copy docker-archive:src docker://${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}:$gitrev