add final project materials #163
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 static pages, trigger GitHub Pages deployment | |
on: | |
push: | |
branches: [ pyladies-en-vienna ] | |
permissions: | |
contents: write | |
concurrency: | |
group: ci-tests-${{ github.ref }}-1 | |
cancel-in-progress: true | |
jobs: | |
deploy: | |
runs-on: ubuntu-22.04 | |
steps: | |
# Checkout code | |
- uses: actions/checkout@v3 | |
# Build base image | |
- name: Build docker image | |
run: docker build . -t naucse-python | |
# Generate static files for website, always exits with code 1 :( | |
- name: Generate static files via freeze | |
run: | | |
docker run --name naucse naucse-python pipenv run freeze || true | |
- name: Copy out static from the container | |
run: | | |
docker cp naucse:/root/.local/share/virtualenvs/-x-v5uFv0/src/naucse/naucse/_build naucse_build | |
if [ -z "$(ls -A naucse_build)" ]; then | |
echo 'Build folder empty, probably a failure in build due to syntax error. Check logs of the run. Aborting.' | |
exit 1 | |
else | |
echo 'Content Exists' | |
fi | |
echo "pyladies.at" > naucse_build/CNAME | |
- name: Deploy github pages | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: naucse_build | |
- name: Cleanup | |
if: always() | |
run: | | |
docker rm naucse |