Files
pc_builder/.gitea/workflows/build.yml
T
Kevin 915e261296
Build & Deploy / build (push) Successful in 25s
Build & Deploy / docker (push) Failing after 0s
try to deploy en nas
2026-06-28 12:40:02 +02:00

47 lines
1.3 KiB
YAML

name: Build & Deploy
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
build:
runs-on: linux
container: node:24
steps:
- name: Checkout repository
run: git clone --depth=1 http://x-access-token:${{ github.token }}@192.168.1.39:3000/${{ github.repository }}.git .
with:
fetch-depth: 0
- name: Install dependencies
run: npm ci
- name: Build project
run: npm run build
docker:
needs: build
runs-on: dind
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Checkout repository
run: git clone --depth=1 http://x-access-token:${{ github.token }}@192.168.1.39:3000/${{ github.repository }}.git .
- name: Login to Gitea Container Registry
run: |
echo "${{ secrets.token }}" | docker login http://192.168.1.39:3000 -u "${{ secrets.username }}" --password-stdin
- name: Build and push Docker image
run: |
IMAGE=192.168.1.39:3000/${{ github.repository }}
docker build -t ${IMAGE}:latest -t ${IMAGE}:${{ github.sha }} .
docker push ${IMAGE}:latest
docker push ${IMAGE}:${{ github.sha }}
- name: Trigger deploy
run: |
curl -X POST http://192.168.1.39:9000/deploy || echo "Deploy webhook not reachable"