-
Notifications
You must be signed in to change notification settings - Fork 5
48 lines (43 loc) · 1.74 KB
/
deploy_master.yaml
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
name: Build master branch and push to production
on:
push:
branches: ["master"]
workflow_dispatch:
inputs:
REUPLOAD_ALL:
description: 'Re-upload all files'
type: boolean
default: false
concurrency:
group: "ftp"
cancel-in-progress: false
defaults:
run:
shell: bash
jobs:
# Build job
# path for newer debs:
# wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.96.0
steps:
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v0.96.0/hugo_extended_${HUGO_VERSION}_Linux-64bit.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Install lftp
run: sudo apt install lftp
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js dependencies
run: "npm ci"
- name: Build with Hugo and Juice
run: bash build_prod.sh
- name: Upload to FTP
run: lftp -c "set sftp:auto-confirm yes ; open -u ${{ secrets.FTP_USER }},${{ secrets.FTP_PASSWORD }} -p ${{ secrets.FTP_PORT }} sftp://${{ secrets.FTP_HOST }} ; mirror -Rn --ignore-time -P 12 upload/ /web/website ; quit"
# if: ${{ github.event_name == 'push' || github.event.inputs.REUPLOAD_ALL == 'false'}}
- name: Upload to FTP (all files)
run: lftp -c "set sftp:auto-confirm yes ; open -u ${{ secrets.FTP_USER }},${{ secrets.FTP_PASSWORD }} -p ${{ secrets.FTP_PORT }} sftp://${{ secrets.FTP_HOST }} ; mirror -R -P 12 upload/ /web/website ; quit"
if: ${{ github.event.inputs.REUPLOAD_ALL == 'true'}}