diff --git a/.forgejo/workflows/publish.yml b/.forgejo/workflows/publish.yml new file mode 100644 index 0000000..29eecb9 --- /dev/null +++ b/.forgejo/workflows/publish.yml @@ -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}}" diff --git a/flake.nix b/flake.nix index 604b2d0..d338329 100644 --- a/flake.nix +++ b/flake.nix @@ -32,7 +32,7 @@ docker = pkgs.dockerTools.buildLayeredImage { name = self.packages.${system}.default.pname; - tag = version; + tag = "latest"; contents = [ self.packages.${system}.default pkgs.busybox ]; config = { Cmd = [ "/bin/app.py" ];