From 9af8b582efbd42c2eac548f4b2ab53ab1c4914ea Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Thu, 11 Jun 2026 16:28:35 -0500 Subject: [PATCH] First pass at workflow --- .gitea/workflows/ci.yaml | 56 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .gitea/workflows/ci.yaml diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml new file mode 100644 index 0000000..5ac76bd --- /dev/null +++ b/.gitea/workflows/ci.yaml @@ -0,0 +1,56 @@ +name: Build, Push, and Deploy + +on: + push: + branches: + - main + +env: + REGISTRY: src.thehellings.com + IMAGE: src.thehellings.com/greg/homepage:latest + +jobs: + build: + runs-on: nix-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build site image + run: | + nix --extra-experimental-features nix-command --extra-experimental-features flakes build . + cp -L result result.tar.gz + + - name: Upload image artifact + uses: actions/upload-artifact@v3 + with: + name: image + path: result.tar.gz + retention-days: 7 + + push: + runs-on: bare-metal + needs: build + steps: + - name: Download image artifact + uses: actions/download-artifact@v3 + with: + name: image + + - name: Log in to Gitea container registry + run: podman login -u ${{ secrets.REGISTRY_USER }} -p ${{ secrets.REGISTRY_PASSWORD }} ${{ env.REGISTRY }} + + - name: Push image + run: | + podman load -i result.tar.gz + podman tag "localhost/gregs-homepage:latest" ${{ env.IMAGE }} + podman push ${{ env.IMAGE }} + + deploy: + runs-on: blog + needs: push + steps: + - name: Pull image and restart service + run: | + sudo podman pull ${{ env.IMAGE }} + sudo systemctl restart podman-homepage