mirror of
https://github.com/modelec/modelec.club.git
synced 2026-01-18 16:37:30 +01:00
Fix deploy
This commit is contained in:
37
.github/workflows/unit-test.yml
vendored
37
.github/workflows/unit-test.yml
vendored
@@ -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
|
||||
Reference in New Issue
Block a user