Compare commits
No commits in common. "17569bdcd4d095476bde9dfdcfdff329bb3d8e98" and "56c60b85bc6574dbea8a3906837ca94a0a8d35b5" have entirely different histories.
17569bdcd4
...
56c60b85bc
2 changed files with 46 additions and 22 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
name: Build and Deploy Hugo Site
|
name: Build Hugo Site
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
|
@ -8,6 +8,7 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.4.0
|
- uses: actions/checkout@v2.4.0
|
||||||
|
|
||||||
|
|
@ -28,7 +29,7 @@ jobs:
|
||||||
uses: actions/setup-node@v4.0.2
|
uses: actions/setup-node@v4.0.2
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version: '20'
|
||||||
cache: 'npm'
|
cache: 'npm' # caching npm dependencies
|
||||||
|
|
||||||
- name: Cache Node modules
|
- name: Cache Node modules
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
|
@ -47,33 +48,27 @@ jobs:
|
||||||
uses: peaceiris/actions-hugo@v3.0.0
|
uses: peaceiris/actions-hugo@v3.0.0
|
||||||
with:
|
with:
|
||||||
hugo-version: '0.121.2'
|
hugo-version: '0.121.2'
|
||||||
extended: true
|
extended: true # Specify to use Hugo Extended version
|
||||||
|
|
||||||
|
- name: Cache Hugo modules
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
resources
|
||||||
|
public
|
||||||
|
key: ${{ runner.os }}-hugo-${{ hashFiles('**/go.sum', '**/package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-hugo-
|
||||||
|
|
||||||
- name: Build Hugo site
|
- name: Build Hugo site
|
||||||
run: hugo --minify
|
run: hugo --minify
|
||||||
|
|
||||||
- name: Upload Artifacts
|
- name: test deployment via FTP
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: hugo-site
|
|
||||||
path: public/
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
needs: build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Download Artifacts
|
|
||||||
uses: actions/download-artifact@v2
|
|
||||||
with:
|
|
||||||
name: hugo-site
|
|
||||||
path: public
|
|
||||||
|
|
||||||
- name: Deploy to Server
|
|
||||||
uses: SamKirkland/FTP-Deploy-Action@4.0.0
|
uses: SamKirkland/FTP-Deploy-Action@4.0.0
|
||||||
with:
|
with:
|
||||||
protocol: ftps
|
protocol: ftps # Ensure to use FTPS
|
||||||
server: ${{ secrets.FTP_SERVER }}
|
server: ${{ secrets.FTP_SERVER }}
|
||||||
username: ${{ secrets.FTP_USERNAME }}
|
username: ${{ secrets.FTP_USERNAME }}
|
||||||
password: ${{ secrets.FTP_PASSWORD }}
|
password: ${{ secrets.FTP_PASSWORD }}
|
||||||
local-dir: public/
|
local-dir: 'public/'
|
||||||
server-dir: '/'
|
server-dir: '/'
|
||||||
|
|
|
||||||
29
amplify.yml
Normal file
29
amplify.yml
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
version: 1
|
||||||
|
frontend:
|
||||||
|
phases:
|
||||||
|
preBuild:
|
||||||
|
commands:
|
||||||
|
- yum install -y curl
|
||||||
|
- curl -LO "https://github.com/gohugoio/hugo/releases/download/v0.121.2/hugo_extended_0.121.2_Linux-64bit.tar.gz"
|
||||||
|
- tar -xvf hugo_extended_0.121.2_Linux-64bit.tar.gz
|
||||||
|
- mv hugo /usr/local/bin/
|
||||||
|
- rm hugo_extended_0.121.2_Linux-64bit.tar.gz
|
||||||
|
- echo "HUGO 0.121.2 INSTALLED"
|
||||||
|
- curl -LO "https://dl.google.com/go/go1.20.5.linux-amd64.tar.gz"
|
||||||
|
- tar -C /usr/local -xzf go1.20.5.linux-amd64.tar.gz
|
||||||
|
- export PATH=$PATH:/usr/local/go/bin
|
||||||
|
- rm go1.20.5.linux-amd64.tar.gz
|
||||||
|
- echo "GO 1.20.5 INSTALLED"
|
||||||
|
- npm install
|
||||||
|
build:
|
||||||
|
commands:
|
||||||
|
- npm run project-setup
|
||||||
|
- npm run build
|
||||||
|
artifacts:
|
||||||
|
# IMPORTANT - Please verify your build output directory
|
||||||
|
baseDirectory: /public
|
||||||
|
files:
|
||||||
|
- "**/*"
|
||||||
|
cache:
|
||||||
|
paths:
|
||||||
|
- node_modules/**/*
|
||||||
Loading…
Add table
Add a link
Reference in a new issue