This commit is contained in:
parent
7cf2f53793
commit
aba2fa9b80
@ -1,32 +1,11 @@
|
|||||||
name: Build image
|
name: Build image
|
||||||
on:
|
on:
|
||||||
push:
|
pull_request:
|
||||||
tags:
|
|
||||||
- 'v*'
|
|
||||||
jobs:
|
jobs:
|
||||||
build-image:
|
build-image:
|
||||||
container:
|
runs-on: nix
|
||||||
image: catthehacker/ubuntu:act-latest
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
# Required for installing nix
|
- run: ls -lah
|
||||||
- name: Install sudo
|
- run: nix build .#image -o image.tar.gz
|
||||||
run: apt-get update && apt-get install -y sudo
|
|
||||||
- name: Install Nix
|
|
||||||
uses: cachix/install-nix-action@v31
|
|
||||||
with:
|
|
||||||
enable_kvm: false
|
|
||||||
- name: Get image meta
|
|
||||||
run: nix build .#image-meta -o image-meta
|
|
||||||
- name: Version check
|
|
||||||
run: |
|
|
||||||
VERSION=$(cat image-meta/version)
|
|
||||||
[ "$GITHUB_REF_NAME" = v"$VERSION" ]
|
|
||||||
- name: Build image
|
|
||||||
run: nix build .#image -o image.tar.gz
|
|
||||||
- run: docker login -u paul -p "$PASSWORD" git.pbrinkmeier.de
|
|
||||||
env:
|
|
||||||
PASSWORD: "${{ secrets.REGISTRY_PASSWORD }}"
|
|
||||||
- run: docker load < image.tar.gz
|
|
||||||
- run: docker image push $(cat image-meta/name)
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user