Merge pull request #153 from CollegiumAcademicum/belegium #122
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 test branch and push to test server (test.collegiumacademicum.de) | |
on: | |
push: | |
branches: ["test"] | |
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_test.sh | |
- name: Upload to FTP (only changed 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 -Rn --ignore-time -P 12 upload/ /web/website_tmp ; 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_tmp ; quit" | |
if: ${{ github.event.inputs.REUPLOAD_ALL == 'true'}} |