2024-02-17 23:33:55 +00:00
|
|
|
name: Publish docker image
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: ['main']
|
2024-02-20 00:03:13 +00:00
|
|
|
paths:
|
|
|
|
- 'backend/**/*'
|
2024-03-11 09:52:59 +00:00
|
|
|
- flake.nix
|
2024-02-17 23:33:55 +00:00
|
|
|
|
|
|
|
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"
|
2024-02-18 11:49:53 +00:00
|
|
|
- name: Log into registry
|
2024-02-18 12:20:08 +00:00
|
|
|
run: "nix shell nixpkgs#crane --command crane auth login git.ashhhleyyy.dev -u ${{github.actor}} -p ${{secrets.PACKAGES_TOKEN}}"
|
2024-02-18 12:12:56 +00:00
|
|
|
- name: Decompress tar.gz
|
|
|
|
run: "gunzip -c result > /tmp/aci.tar"
|
2024-02-18 11:49:53 +00:00
|
|
|
- name: Push image (latest)
|
2024-02-18 12:12:56 +00:00
|
|
|
run: "nix shell nixpkgs#crane --command crane push /tmp/aci.tar git.ashhhleyyy.dev/ash/aci:latest"
|
2024-02-18 11:58:14 +00:00
|
|
|
- name: Push image
|
2024-02-18 12:12:56 +00:00
|
|
|
run: "nix shell nixpkgs#crane --command crane push /tmp/aci.tar git.ashhhleyyy.dev/ash/aci:${{github.sha}}"
|