-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (45 loc) · 1.37 KB
/
deploy.yml
File metadata and controls
54 lines (45 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Deploy MSK Scripts Docs
on:
push:
branches:
- main
# SECURITY: GITHUB_TOKEN auf Minimum beschränken
permissions:
contents: read
jobs:
build-and-deploy:
name: Build & Deploy
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 🟢 Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
- name: 📦 Install Dependencies
run: yarn install --frozen-lockfile
- name: 🏗️ Build Project
run: yarn build
- name: 🚀 Deploy to Server via SFTP
uses: appleboy/scp-action@master
with:
host: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: ${{ secrets.FTP_PORT }}
source: "build/*"
target: "/var/www/html/docs_msk-scripts/"
strip_components: 1
- name: 🛠️ Setze Datei-Besitzer auf www-data
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: ${{ secrets.FTP_PORT }}
script: |
chown -R www-data:www-data /var/www/html/docs_msk-scripts/