summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorseth <[email protected]>2023-04-07 03:10:00 -0400
committerseth <[email protected]>2023-04-07 03:42:48 -0400
commit4e4d8f3fb2108227426c28f05649eb67a78d180e (patch)
tree74324417d2ec8de376c5b3e003191b837f76d581 /.github/workflows
parent797297d1e6f1b9098aed473b2fc22b3236a525eb (diff)
upload container images to ghcr
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/ci.yml28
1 files changed, 26 insertions, 2 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 77c8e11..43b5dd3 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -17,11 +17,19 @@ on:
jobs:
build:
+ runs-on: ubuntu-latest
+
+ permissions:
+ contents: read
+ packages: write
+
strategy:
matrix:
output: [teawiebot, container]
- runs-on: ubuntu-latest
+ env:
+ REGISTRY: ghcr.io
+
steps:
- uses: actions/checkout@v3
@@ -29,5 +37,21 @@ jobs:
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- - run: |
+ - name: login to ghcr
+ if: ${{ matrix.output == 'container' && github.ref == 'refs/heads/main' }}
+ uses: docker/login-action@v2
+ with:
+ registry: ${{ env.REGISTRY }}
+ username: "getchoo"
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: build
+ run: |
nix build .#${{ matrix.output }}
+
+ - name: upload to ghcr
+ if: ${{ matrix.output == 'container' && github.ref == 'refs/heads/main' }}
+ run: |
+ docker load < result
+ docker tag teawiebot:latest ghcr.io/getchoo/teawiebot:latest
+ docker push ghcr.io/getchoo/teawiebot:latest