Repository navigation
61 lines (51 loc) · 1.65 KB
/
Copy pathdeploy.yml
File metadata and controls
61 lines (51 loc) · 1.65 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
55
56
57
58
59
60
61
name: Deploy Chezza Docs
on:
push:
branches:
- main
# SECURITY: GITHUB_TOKEN auf Minimum beschränken
permissions:
contents: read
# One deploy at a time per repository. A newer push replaces a pending run,
# but a running deploy is never interrupted, so the server is never left
# half updated. Several merges in a row end up as at most two deploys.
concurrency:
group: deploy-production
cancel-in-progress: false
jobs:
build-and-deploy:
name: Build & Deploy
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout Repository
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: 🟢 Setup Node.js
uses: actions/setup-node@v7
with:
node-version: 24
cache: yarn
- name: 📦 Install Dependencies
run: yarn install --frozen-lockfile
- name: 🏗️ Build Project
run: yarn build
- name: 🚀 Deploy to Server via SCP
uses: appleboy/scp-action@v1.0.0
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_chezza/"
strip_components: 1
- name: 🛠️ Post-Deploy Setup (Permissions & Security Headers)
uses: appleboy/ssh-action@v1.2.5
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_chezza/