diff --git a/.forgejo/workflows/atticd.yaml b/.forgejo/workflows/atticd.yaml index 053e290..e0854bd 100644 --- a/.forgejo/workflows/atticd.yaml +++ b/.forgejo/workflows/atticd.yaml @@ -7,19 +7,19 @@ jobs: image: git.kun.is/home/forgejo-nix-action:687d16c49ea7936068bac64ec68c480a9d681962 steps: - name: Clone repository - run: git clone https://git.kun.is/home/container-images.git checkout + run: git clone ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git src - name: Setup Nix cache run: | - /bin/attic login local https://attic.kun.is ${{ secrets.ATTIC_TOKEN }} - /bin/attic use home - - name: Build Atticd - run: nix build --out-link atticd ./checkout#packages.x86_64-linux.atticd - - name: Push atticd to Nix cache - run: /bin/attic push home atticd + /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 pim --password ${{ secrets.RUNNER_TOKEN }} https://git.kun.is - - name: Push atticd to 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:./atticd docker://git.kun.is/home/atticd:latest - gitrev=$(git --git-dir checkout/.git --work-tree checkout rev-parse HEAD) - /bin/skopeo --insecure-policy copy docker-archive:./atticd docker://git.kun.is/home/atticd:$gitrev + /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 diff --git a/.forgejo/workflows/blog-pim.yaml b/.forgejo/workflows/blog-pim.yaml index 1039e08..c46a341 100644 --- a/.forgejo/workflows/blog-pim.yaml +++ b/.forgejo/workflows/blog-pim.yaml @@ -6,19 +6,19 @@ jobs: image: git.kun.is/home/forgejo-nix-action:687d16c49ea7936068bac64ec68c480a9d681962 steps: - name: Clone repository - run: git clone https://git.kun.is/home/container-images.git checkout + run: git clone ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git src - name: Setup Nix cache run: | - /bin/attic login local https://attic.kun.is ${{ secrets.ATTIC_TOKEN }} - /bin/attic use home - - name: Build blog-pim - run: nix build --out-link blog-pim ./checkout#packages.x86_64-linux.blog-pim - - name: Push blog-pim to Nix cache - run: /bin/attic push home blog-pim + /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.blog-pim + - 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 pim --password ${{ secrets.RUNNER_TOKEN }} https://git.kun.is - - name: Push blog-pim to 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:./blog-pim docker://git.kun.is/home/blog-pim:latest - gitrev=$(git --git-dir checkout/.git --work-tree checkout rev-parse HEAD) - /bin/skopeo --insecure-policy copy docker-archive:./blog-pim docker://git.kun.is/home/blog-pim:$gitrev + /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 diff --git a/.forgejo/workflows/forgejo-nix-action.yaml b/.forgejo/workflows/forgejo-nix-action.yaml index 938afbe..27fb10b 100644 --- a/.forgejo/workflows/forgejo-nix-action.yaml +++ b/.forgejo/workflows/forgejo-nix-action.yaml @@ -6,19 +6,19 @@ jobs: image: git.kun.is/home/forgejo-nix-action:687d16c49ea7936068bac64ec68c480a9d681962 steps: - name: Clone repository - run: git clone https://git.kun.is/home/container-images.git checkout + run: git clone ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git src - name: Setup Nix cache run: | - /bin/attic login local https://attic.kun.is ${{ secrets.ATTIC_TOKEN }} - /bin/attic use home - - name: Build forgejo-nix-action - run: nix build --out-link forgejo-nix-action ./checkout#packages.x86_64-linux.forgejo-nix-action - - name: Push forgjeo-nix-action to Nix cache - run: /bin/attic push home forgejo-nix-action + /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.forgejo-nix-action + - 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 pim --password ${{ secrets.RUNNER_TOKEN }} https://git.kun.is - - name: Push forgejo-nix-action to 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:./forgejo-nix-action docker://git.kun.is/home/forgejo-nix-action:latest - gitrev=$(git --git-dir checkout/.git --work-tree checkout rev-parse HEAD) - /bin/skopeo --insecure-policy copy docker-archive:./forgejo-nix-action docker://git.kun.is/home/forgejo-nix-action:$gitrev + /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