Fix deploy

This commit is contained in:
Félix MARQUET
2024-10-18 11:16:30 +02:00
committed by GitHub
parent 903a3f5fb5
commit 2a20d834af

View File

@@ -8,7 +8,6 @@ on:
jobs:
build:
runs-on: ubuntu-latest
environment: recette
steps:
- name: Checkout code
@@ -36,6 +35,7 @@ jobs:
test:
runs-on: ubuntu-latest
needs: build
environment: recette
steps:
- name: Checkout code
@@ -83,4 +83,37 @@ jobs:
port: ${{ secrets.SERVER_PORT }}
uploads: |
./dist => /var/www/modelec.club
dry-run: true
dry-run: true
deploy:
runs-on: ubuntu-latest
needs: test
environment: production
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: ./dist
- name: Copy build directory to server
uses: Dylan700/sftp-upload-action@v1.2.3
with:
server: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWORD }}
port: ${{ secrets.SERVER_PORT }}
uploads: |
./dist => /var/www/modelec.club
delete: true