ci: simplification workflow — commandes shell directes
Build & Deploy / build-push-deploy (push) Has been cancelled
Build & Deploy / build-push-deploy (push) Has been cancelled
This commit is contained in:
+10
-19
@@ -9,7 +9,7 @@ env:
|
||||
IMAGE: gitea.lan/shaz/le-site-de-ma-mamounette
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
build-push-deploy:
|
||||
runs-on: homelab
|
||||
|
||||
steps:
|
||||
@@ -17,25 +17,16 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Login au registry Gitea
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ gitea.actor }}
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login gitea.lan -u shaz --password-stdin
|
||||
|
||||
- name: Build & push image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ env.IMAGE }}:latest
|
||||
|
||||
deploy:
|
||||
runs-on: homelab
|
||||
needs: build-and-push
|
||||
|
||||
steps:
|
||||
- name: Pull nouvelle image & redémarrer
|
||||
run: |
|
||||
docker pull ${{ env.IMAGE }}:latest
|
||||
docker build -t ${{ env.IMAGE }}:latest .
|
||||
docker push ${{ env.IMAGE }}:latest
|
||||
|
||||
- name: Déployer sur le serveur
|
||||
run: |
|
||||
docker compose -f /srv/ssd/stacks/moulin/docker-compose.yml pull
|
||||
docker compose -f /srv/ssd/stacks/moulin/docker-compose.yml up -d
|
||||
|
||||
docker compose -f /srv/ssd/stacks/moulin/docker-compose.yml up -d --pull always
|
||||
|
||||
Reference in New Issue
Block a user