summaryrefslogtreecommitdiff
path: root/.github/workflows/upload.yaml
diff options
context:
space:
mode:
authorseth <[email protected]>2023-07-02 15:46:53 -0400
committerseth <[email protected]>2023-07-02 19:59:45 +0000
commit3d05c4bff2b446a3a246b8b802e407b9cc1371c6 (patch)
treed12d571b4a918fe673f4c2de2131fb57bbbb5a11 /.github/workflows/upload.yaml
parent57783697051e75142268f21a834e62da9d239017 (diff)
ci!: start using garnix
Diffstat (limited to '.github/workflows/upload.yaml')
-rw-r--r--.github/workflows/upload.yaml42
1 files changed, 42 insertions, 0 deletions
diff --git a/.github/workflows/upload.yaml b/.github/workflows/upload.yaml
new file mode 100644
index 0000000..1122491
--- /dev/null
+++ b/.github/workflows/upload.yaml
@@ -0,0 +1,42 @@
+name: upload to registry
+# this is for uploading images to a container registry when
+# changes are made to `main`
+
+on:
+ check_suite:
+ types: [completed]
+
+permissions:
+ packages: write
+
+jobs:
+ upload:
+ runs-on: ubuntu-latest
+
+ env:
+ REGISTRY: ghcr.io
+ USERNAME: getchoo
+
+ steps:
+ - uses: actions/checkout@v3
+ - uses: cachix/install-nix-action@v22
+
+ - name: fetch docker image
+ run: |
+ nix build --accept-flake-config -L .#container
+ readlink result | xargs -I {} cp {} teawiebot.tar.gz
+
+ - name: login to ${{ env.REGISTRY }}
+ uses: docker/login-action@v2
+ with:
+ registry: ${{ env.REGISTRY }}
+ username: ${{ env.USERNAME }}
+ password: ${{ github.token }}
+
+ - name: upload to ${{ env.REGISTRY }}
+ env:
+ PUSH_PREFIX: ${{ env.REGISTRY }}/${{ env.USERNAME }}
+ run: |
+ docker load < teawiebot.tar.gz
+ docker tag teawiebot:latest ${{ env.REGISTRY_PREFIX }}/teawiebot:latest
+ docker push ${{ env.PUSH_PREFIX }}/teawiebot:latest