feat(ci): lets see if i've written a workflow correctly first time (doubt it lol)

This commit is contained in:
Ashhhleyyy 2024-02-17 23:33:55 +00:00
parent 49aab6fd64
commit 0df50073d5
Signed by: ash
GPG key ID: 83B789081A0878FB
2 changed files with 31 additions and 1 deletions

View 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}}"

View file

@ -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" ];