feat(ci): lets see if i've written a workflow correctly first time (doubt it lol)
This commit is contained in:
parent
49aab6fd64
commit
0df50073d5
2 changed files with 31 additions and 1 deletions
30
.forgejo/workflows/publish.yml
Normal file
30
.forgejo/workflows/publish.yml
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
name: Publish docker image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ['main']
|
||||||
|
|
||||||
|
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: Load image
|
||||||
|
run: "docker load < result"
|
||||||
|
- name: Retag image
|
||||||
|
run: "docker image tag aci-backend:latest git.ashhhleyyy.dev/ash/aci:latest && docker image tag aci-backend:latest git.ashhhleyyy.dev/ash/aci:${{github.sha}}"
|
||||||
|
- name: Log in to registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Push images
|
||||||
|
run: "docker push git.ashhhleyyy.dev/ash/aci:latest git.ashhhleyyy.dev:${{github.sha}}"
|
|
@ -32,7 +32,7 @@
|
||||||
|
|
||||||
docker = pkgs.dockerTools.buildLayeredImage {
|
docker = pkgs.dockerTools.buildLayeredImage {
|
||||||
name = self.packages.${system}.default.pname;
|
name = self.packages.${system}.default.pname;
|
||||||
tag = version;
|
tag = "latest";
|
||||||
contents = [ self.packages.${system}.default pkgs.busybox ];
|
contents = [ self.packages.${system}.default pkgs.busybox ];
|
||||||
config = {
|
config = {
|
||||||
Cmd = [ "/bin/app.py" ];
|
Cmd = [ "/bin/app.py" ];
|
||||||
|
|
Loading…
Reference in a new issue