aci/.forgejo/workflows/publish.yml
Ashhhleyyy 246f4e11b7
All checks were successful
Build extension ZIP / Build extension (push) Successful in 57s
Publish docker image / Publish (push) Successful in 2m49s
fix(ci): always run when flake.nix changed
2024-03-11 09:52:59 +00:00

29 lines
975 B
YAML

name: Publish docker image
on:
push:
branches: ['main']
paths:
- 'backend/**/*'
- flake.nix
jobs:
publish:
name: Publish
runs-on: docker
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install nix
uses: https://github.com/cachix/install-nix-action@v25
- name: Build image
run: "nix --extra-experimental-features 'nix-command,flakes' build .#docker"
- name: Log into registry
run: "nix shell nixpkgs#crane --command crane auth login git.ashhhleyyy.dev -u ${{github.actor}} -p ${{secrets.PACKAGES_TOKEN}}"
- name: Decompress tar.gz
run: "gunzip -c result > /tmp/aci.tar"
- name: Push image (latest)
run: "nix shell nixpkgs#crane --command crane push /tmp/aci.tar git.ashhhleyyy.dev/ash/aci:latest"
- name: Push image
run: "nix shell nixpkgs#crane --command crane push /tmp/aci.tar git.ashhhleyyy.dev/ash/aci:${{github.sha}}"