From 281af6b2ec09f26c2eba14864aefe0ac3a86d7cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20M=C3=A5rdbrink?= Date: Wed, 3 Dec 2025 22:26:49 +0100 Subject: [PATCH] Add action --- .forgejo/workflows/deploy.yml | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml index 828fc8d..0df3ec4 100644 --- a/.forgejo/workflows/deploy.yml +++ b/.forgejo/workflows/deploy.yml @@ -1,18 +1,23 @@ - name: Deploy +name: Build and Push - on: - push: - branches: [main] +on: + push: + branches: [main] - jobs: - deploy: - runs-on: native - steps: - - uses: actions/checkout@v4 +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build and push to registry + run: | + # Build the image + docker build -t git.mardbrink.se/hugomardbrink/hugo.mardbrink.se:latest . + + # Login to Forgejo registry (requires FORGEJO_TOKEN secret) + echo "${{ secrets.FORGEJO_TOKEN }}" | docker login git.mardbrink.se -u hugomardbrink --password-stdin + + # Push to registry + docker push git.mardbrink.se/hugomardbrink/hugo.mardbrink.se:latest - - name: Build and deploy - run: | - sudo podman build -t hugo-home:latest . - sudo podman stop hugo-home 2>/dev/null || true - sudo podman rm hugo-home 2>/dev/null || true - sudo podman run -d --name hugo-home --restart=always -p 127.0.0.1:8080:8080 hugo-home:latest