Skip to content

Commit

Permalink
Add GitHub Actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
pathob committed May 30, 2024
1 parent 9b8a8aa commit cefdb66
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [ published ]

jobs:

build:
name: Build Image

runs-on: ubuntu-24.04

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Nix
uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-23.11

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Login to GitHub container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build image
run: |
nix build
- name: Load image and store ID
id: image
run: |
image_id=$(docker load < result | sed -n 's/^Loaded image: //p')
echo "image_id=${image_id}" >> "$GITHUB_OUTPUT"
- name: Print image ID
run: |
echo "${{ steps.image.outputs.image_id }}"

0 comments on commit cefdb66

Please sign in to comment.