try to deploy en nas
This commit is contained in:
@@ -1,17 +1,18 @@
|
|||||||
name: Build Project
|
name: Build & Deploy
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main, master]
|
branches: [main]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [main, master]
|
branches: [main]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: linux # Doit correspondre à GITEA_RUNNER_LABELS (ex: linux:docker,dind)
|
runs-on: linux
|
||||||
container: node:24 # Utilise l'image officielle Node.js 24
|
container: node:24
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4 # Action Gitea pour checkout
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
@@ -20,3 +21,36 @@ jobs:
|
|||||||
|
|
||||||
- name: Build project
|
- name: Build project
|
||||||
run: npm run build
|
run: npm run build
|
||||||
|
|
||||||
|
docker:
|
||||||
|
needs: build
|
||||||
|
runs-on: linux
|
||||||
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Login to Gitea Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: http://192.168.1.39:3000
|
||||||
|
username: ${{ secrets.GITEA_USERNAME }}
|
||||||
|
password: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
192.168.1.39:3000/username/pc-builder:latest
|
||||||
|
192.168.1.39:3000/username/pc-builder:${{ github.sha }}
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
|
- name: Trigger deploy
|
||||||
|
run: |
|
||||||
|
curl -X POST http://192.168.1.39:9000/deploy || echo "Deploy webhook not reachable"
|
||||||
|
|||||||
Reference in New Issue
Block a user