-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (58 loc) · 2.04 KB
/
ftpdeploy.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: "Deploy Static Files to Server"
on:
workflow_dispatch:
push:
branches:
- main
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
environment:
name: FTP
steps:
- name: "Checking Out"
uses: actions/[email protected]
- name: Setting Up Node.js
uses: actions/[email protected]
with:
node-version: "21"
cache: "yarn"
- name: Installing dependencies
run: yarn
- name: Generating Static Files
run: yarn build
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/[email protected]
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: "Caching build"
uses: actions/[email protected]
with:
path: |
~/.npm
${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
- name: Deploy to Server
uses: SamKirkland/[email protected]
with:
server: cresteem.com
port: ${{ secrets.FTP_PORT }}
username: ${{ secrets.FTP_UNAME }}
password: ${{ secrets.FTP_PASS }}
protocol: ftps
local-dir: ./opensource/
server-dir: /opensource/
log-level: verbose
security: strict