Skip to content

Workflow file for this run

name: Build static pages, trigger GitHub Pages deployment
on:
push:
#change branch name to trigger deployment.
branches: [ sudan-house ]
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 sudan-house
# Generate static files for website, always exits with code 1 :(
- name: Generate static files via freeze
run: |
docker run --name naucse sudan-house 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 "sudan-house-training.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