Skip to content

Merge pull request #55 from jduar/dev #22

Merge pull request #55 from jduar/dev

Merge pull request #55 from jduar/dev #22

Workflow file for this run

name: Generate example website and deploy
on:
push:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create env file
run: |
touch .env
echo "PAGES_FOLDER=./example_content/pages" >> .env
echo "PICTURES_FOLDER=./example_content/images" >> .env
echo "FAVICON=./example_content/favicon.ico" >> .env
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip' # caching pip dependencies
- run: pip install -r requirements.txt
- run: python3 generator.py
- name: Init new repo and commit generated files
run: |
mv ./example_content/images ./public/images
cd public
git init
git add --all
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -m 'deploy'
- name: Force push to destination branch
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
force: true
directory: ./public