Merge pull request #157 from CollegiumAcademicum/update_events #82
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'}} |