aci/.forgejo/workflows/publish.yml

30 lines
969 B
YAML

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