48 lines
No EOL
1.2 KiB
YAML
48 lines
No EOL
1.2 KiB
YAML
name: Deploy
|
|
|
|
on: [ push ]
|
|
jobs:
|
|
build:
|
|
runs-on: docker
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: true
|
|
fetch-depth: 0
|
|
|
|
- name: Cache Hugo binary
|
|
id: cache-hugo
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: hugo
|
|
key: ${{ runner.os }}-hugo
|
|
|
|
- name: Download Hugo
|
|
if: steps.cache-hugo.outputs.cache-hit != 'true'
|
|
run: |
|
|
curl -L -o hugo_0.140.0_linux-amd64.tar.gz https://github.com/gohugoio/hugo/releases/download/v0.140.0/hugo_0.140.0_linux-amd64.tar.gz
|
|
tar zxvf hugo_0.140.0_linux-amd64.tar.gz
|
|
|
|
- name: Build website
|
|
run: ./hugo
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: website
|
|
path: public/
|
|
|
|
deploy:
|
|
runs-on: docker
|
|
steps:
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: website
|
|
|
|
- name: Install lftp
|
|
run: |
|
|
apt update
|
|
apt install -y lftp
|
|
|
|
- name: Deploy website
|
|
run: lftp -c "open -u ${{ secrets.FTP_USER }},${{ secrets.FTP_PASS }} ${{ secrets.FTP_HOST }}; mirror -R . ~/${{ secrets.FTP_DIR }}; quit" |