Aerodesignworks #12
This file contains hidden or 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 and deploy jekyll website | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| - closed | |
| jobs: | |
| build-upload: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Setup build environment | |
| run: | | |
| sudo gem install jekyll bundler | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| - name: Setup build environment II | |
| run: | | |
| sudo bundle install | |
| - name: Build website | |
| run: | | |
| bundle exec jekyll --version | |
| bundle exec jekyll build | |
| - name: Convert iCalendar file line endings to CRLF | |
| run: | | |
| cp _site/techaachen-calendar.ics _site/techaachen-calendar.ics.in | |
| sed $'s/$/\r/' _site/techaachen-calendar.ics.in > _site/techaachen-calendar.ics | |
| rm _site/techaachen-calendar.ics.in | |
| - name: Upload to www.techaachen.de | |
| if: github.event.pull_request.merged == true | |
| env: | |
| UPLOAD_AUTH_2: ${{ secrets.UPLOAD_AUTH_2 }} | |
| run: | | |
| cd _site | |
| find -type f -print0 | sed -z 's/^.\///' | xargs -P8 -I{} -0 curl -s --user $UPLOAD_AUTH_2 --fail -w '%{method} %{url} %{http_code}\n' -X PUT --upload-file ./{} https://www.techaachen.de/{} | |
| - name: Upload to preview.techaachen.de | |
| if: github.event.pull_request.merged != true | |
| env: | |
| UPLOAD_AUTH_2: ${{ secrets.UPLOAD_AUTH_2 }} | |
| run: | | |
| export BRANCH=$(echo ${{github.head_ref}}|sed 's|refs/heads||') | |
| echo $BRANCH | |
| cd _site | |
| curl -s --user $UPLOAD_AUTH_2 -X DELETE https://preview.techaachen.de/$BRANCH/ || true | |
| find -type f -print0 | sed -z 's/^.\///' | xargs -P8 -I{} -0 curl -s --user $UPLOAD_AUTH_2 --fail -w '%{method} %{url} %{http_code}\n' -X PUT --upload-file ./{} https://preview.techaachen.de/$BRANCH/{} |