-
-
Notifications
You must be signed in to change notification settings - Fork 3
77 lines (64 loc) · 2.42 KB
/
publish-posts.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
69
70
71
72
73
74
75
76
77
name: Publish Posts
on:
create:
tags:
repository_dispatch:
types: [post-change-event]
jobs:
build-deploy:
runs-on: ubuntu-latest
name: Publish Website to Staging Server
steps:
- uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: "14"
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: "7.4"
tools: composer
- name: Get yarn cache directory path
id: yarn-cache-dir
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache yarn dependencies
uses: actions/cache@v1
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn-
- name: Install yarn dependencies
# as we allow any keys we have to run the installer anyway
# see: https://help.github.com/en/actions/configuring-and-managing-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key
# if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install
- name: Get composer cache directory
id: composer-cache-dir
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v1
id: composer-cache
with:
path: ${{ steps.composer-cache-dir.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
${{ runner.os }}-composer-
- name: Install Composer dependencies
# as we allow any keys we have to run the installer anyway
# if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress
- name: Run build
run: yarn run production
- name: Upload posts
uses: genietim/ftp-action@master
with:
host: sftp://lx3.hoststar.hosting:5544
user: ${{ secrets.FTP_USER }}
password: ${{ secrets.FTP_PASSWORD }}
localDir: ./build_production/blog/
remoteDir: "www.genieblog.ch/public_html/blog/"