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