-
Notifications
You must be signed in to change notification settings - Fork 1
35 lines (35 loc) · 1.26 KB
/
container.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: "Docker Image"
on:
push:
env:
REGISTRY: ghcr.io
jobs:
build:
strategy:
fail-fast: false
matrix:
arch:
- x86_64-linux
# Disabled for now due to qemu segfault issue
# - aarch64-linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v2
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v4
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix run -L --system ${{ matrix.arch }} --extra-platforms ${{ matrix.arch }} .#container.copyToDockerDaemon
- name: Log in to the Container registry
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Tag and push Docker image
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
run: |
TAG=$(nix eval '.#lanparty-seating.version' | sed s/\"//g)
docker tag lanparty-seating:$TAG ghcr.io/otakulan/lanparty-seating/lanparty-seating:$TAG
docker push ghcr.io/otakulan/lanparty-seating/lanparty-seating:$TAG