This commit is contained in:
@@ -0,0 +1,46 @@
|
|||||||
|
name: Build & Deploy
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Build image (amd64)
|
||||||
|
run: |
|
||||||
|
docker buildx build \
|
||||||
|
--platform linux/amd64 \
|
||||||
|
--output type=docker \
|
||||||
|
-t budget-commun:latest \
|
||||||
|
-f backend/Dockerfile .
|
||||||
|
|
||||||
|
- name: Configurer la clé SSH
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
echo "${{ secrets.NAS_SSH_KEY }}" > ~/.ssh/nas_key
|
||||||
|
chmod 600 ~/.ssh/nas_key
|
||||||
|
|
||||||
|
- name: Transférer l'image sur TrueNAS
|
||||||
|
run: |
|
||||||
|
docker save budget-commun:latest | \
|
||||||
|
ssh -i ~/.ssh/nas_key \
|
||||||
|
-o StrictHostKeyChecking=no \
|
||||||
|
admin@192.168.1.200 \
|
||||||
|
"sudo docker load"
|
||||||
|
|
||||||
|
- name: Redéployer l'app
|
||||||
|
run: |
|
||||||
|
ssh -i ~/.ssh/nas_key \
|
||||||
|
-o StrictHostKeyChecking=no \
|
||||||
|
admin@192.168.1.200 \
|
||||||
|
"sudo midclt call app.redeploy 'budget-commun'"
|
||||||
Reference in New Issue
Block a user