Generalize Forgejo workflows
This commit is contained in:
parent
c6ee065273
commit
d627220fed
3 changed files with 36 additions and 36 deletions
|
@ -7,19 +7,19 @@ jobs:
|
||||||
image: git.kun.is/home/forgejo-nix-action:687d16c49ea7936068bac64ec68c480a9d681962
|
image: git.kun.is/home/forgejo-nix-action:687d16c49ea7936068bac64ec68c480a9d681962
|
||||||
steps:
|
steps:
|
||||||
- name: Clone repository
|
- 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
|
- name: Setup Nix cache
|
||||||
run: |
|
run: |
|
||||||
/bin/attic login local https://attic.kun.is ${{ secrets.ATTIC_TOKEN }}
|
/bin/attic login local ${{ vars.ATTIC_URL }} ${{ secrets.ATTIC_TOKEN }}
|
||||||
/bin/attic use home
|
/bin/attic use ${{ vars.ATTIC_CACHE }}
|
||||||
- name: Build Atticd
|
- name: Build image
|
||||||
run: nix build --out-link atticd ./checkout#packages.x86_64-linux.atticd
|
run: nix build --out-link image src#packages.x86_64-linux.atticd
|
||||||
- name: Push atticd to Nix cache
|
- name: Push image to Nix cache
|
||||||
run: /bin/attic push home atticd
|
run: /bin/attic push ${{ vars.ATTIC_CACHE }} image
|
||||||
- name: Log into container registry
|
- name: Log into container registry
|
||||||
run: /bin/skopeo login --tls-verify --username pim --password ${{ secrets.RUNNER_TOKEN }} https://git.kun.is
|
run: /bin/skopeo login --tls-verify --username ${{ vars.RUNNER_USER }} --password ${{ secrets.RUNNER_TOKEN }} ${GITHUB_SERVER_URL}
|
||||||
- name: Push atticd to container registry
|
- name: Push image to container registry
|
||||||
run: |
|
run: |
|
||||||
/bin/skopeo --insecure-policy copy docker-archive:./atticd docker://git.kun.is/home/atticd:latest
|
/bin/skopeo --insecure-policy copy docker-archive:image docker://${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}:latest
|
||||||
gitrev=$(git --git-dir checkout/.git --work-tree checkout rev-parse HEAD)
|
gitrev=$(git --git-dir src/.git --work-tree src 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:src docker://${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}:$gitrev
|
||||||
|
|
|
@ -6,19 +6,19 @@ jobs:
|
||||||
image: git.kun.is/home/forgejo-nix-action:687d16c49ea7936068bac64ec68c480a9d681962
|
image: git.kun.is/home/forgejo-nix-action:687d16c49ea7936068bac64ec68c480a9d681962
|
||||||
steps:
|
steps:
|
||||||
- name: Clone repository
|
- 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
|
- name: Setup Nix cache
|
||||||
run: |
|
run: |
|
||||||
/bin/attic login local https://attic.kun.is ${{ secrets.ATTIC_TOKEN }}
|
/bin/attic login local ${{ vars.ATTIC_URL }} ${{ secrets.ATTIC_TOKEN }}
|
||||||
/bin/attic use home
|
/bin/attic use ${{ vars.ATTIC_CACHE }}
|
||||||
- name: Build blog-pim
|
- name: Build image
|
||||||
run: nix build --out-link blog-pim ./checkout#packages.x86_64-linux.blog-pim
|
run: nix build --out-link image src#packages.x86_64-linux.blog-pim
|
||||||
- name: Push blog-pim to Nix cache
|
- name: Push image to Nix cache
|
||||||
run: /bin/attic push home blog-pim
|
run: /bin/attic push ${{ vars.ATTIC_CACHE }} image
|
||||||
- name: Log into container registry
|
- name: Log into container registry
|
||||||
run: /bin/skopeo login --tls-verify --username pim --password ${{ secrets.RUNNER_TOKEN }} https://git.kun.is
|
run: /bin/skopeo login --tls-verify --username ${{ vars.RUNNER_USER }} --password ${{ secrets.RUNNER_TOKEN }} ${GITHUB_SERVER_URL}
|
||||||
- name: Push blog-pim to container registry
|
- name: Push image to container registry
|
||||||
run: |
|
run: |
|
||||||
/bin/skopeo --insecure-policy copy docker-archive:./blog-pim docker://git.kun.is/home/blog-pim:latest
|
/bin/skopeo --insecure-policy copy docker-archive:image docker://${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}:latest
|
||||||
gitrev=$(git --git-dir checkout/.git --work-tree checkout rev-parse HEAD)
|
gitrev=$(git --git-dir src/.git --work-tree src 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:src docker://${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}:$gitrev
|
||||||
|
|
|
@ -6,19 +6,19 @@ jobs:
|
||||||
image: git.kun.is/home/forgejo-nix-action:687d16c49ea7936068bac64ec68c480a9d681962
|
image: git.kun.is/home/forgejo-nix-action:687d16c49ea7936068bac64ec68c480a9d681962
|
||||||
steps:
|
steps:
|
||||||
- name: Clone repository
|
- 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
|
- name: Setup Nix cache
|
||||||
run: |
|
run: |
|
||||||
/bin/attic login local https://attic.kun.is ${{ secrets.ATTIC_TOKEN }}
|
/bin/attic login local ${{ vars.ATTIC_URL }} ${{ secrets.ATTIC_TOKEN }}
|
||||||
/bin/attic use home
|
/bin/attic use ${{ vars.ATTIC_CACHE }}
|
||||||
- name: Build forgejo-nix-action
|
- name: Build image
|
||||||
run: nix build --out-link forgejo-nix-action ./checkout#packages.x86_64-linux.forgejo-nix-action
|
run: nix build --out-link image src#packages.x86_64-linux.forgejo-nix-action
|
||||||
- name: Push forgjeo-nix-action to Nix cache
|
- name: Push image to Nix cache
|
||||||
run: /bin/attic push home forgejo-nix-action
|
run: /bin/attic push ${{ vars.ATTIC_CACHE }} image
|
||||||
- name: Log into container registry
|
- name: Log into container registry
|
||||||
run: /bin/skopeo login --tls-verify --username pim --password ${{ secrets.RUNNER_TOKEN }} https://git.kun.is
|
run: /bin/skopeo login --tls-verify --username ${{ vars.RUNNER_USER }} --password ${{ secrets.RUNNER_TOKEN }} ${GITHUB_SERVER_URL}
|
||||||
- name: Push forgejo-nix-action to container registry
|
- name: Push image to container registry
|
||||||
run: |
|
run: |
|
||||||
/bin/skopeo --insecure-policy copy docker-archive:./forgejo-nix-action docker://git.kun.is/home/forgejo-nix-action:latest
|
/bin/skopeo --insecure-policy copy docker-archive:image docker://${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}:latest
|
||||||
gitrev=$(git --git-dir checkout/.git --work-tree checkout rev-parse HEAD)
|
gitrev=$(git --git-dir src/.git --work-tree src 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:src docker://${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}:$gitrev
|
||||||
|
|
Reference in a new issue