-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (40 loc) · 1.17 KB
/
build-and-deploy.yml
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
name: Build and Deploy
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: Set timezone
uses: szenius/[email protected]
with:
timezoneLinux: "Europe/Paris"
timezoneMacos: "Europe/Paris"
timezoneWindows: "Paris Standard Time"
- name: Set build date
run: echo 'BUILD_DATE="'$(date '+%Y-%m-%dT%H:%M:00')'"' > .env
- name: Build
run: npm run build
- name: add robots.txt
run: echo 'User-agent:*' > ./dist/robots.txt && echo 'Disallow:' >> ./dist/robots.txt
- name: copy file via ssh password
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSHKEY }}
port: ${{ secrets.PORT }}
source: ./dist/*
target: ${{ secrets.SERVER_FOLDER }}
strip_components: 1
rm: true