Skip to content

Merge pull request #25 from davekempe/main #59

Merge pull request #25 from davekempe/main

Merge pull request #25 from davekempe/main #59

Workflow file for this run

name: Validate and Build plus publish.
on:
push:
branches:
- main
workflow_dispatch:
jobs:
validate:
runs-on:
labels: ubuntu-latest
container:
image: public.ecr.aws/g6m3a0y9/landscape2
options: --user root
steps:
- name: Install git
run: apk add git
- name: Checkout this repository
uses: actions/checkout@v4
- name: Validate settings
run: landscape2 validate settings --settings-file ./settings.yml
- name: Validate data
run: landscape2 validate data --data-file ./data.yml
- name: Validate guide
run: landscape2 validate guide --guide-file ./guide.yml
- name: Validate games
run: landscape2 validate games --games-file ./games.yml
build:
environment: github-pages
needs: validate
runs-on:
labels: ubuntu-latest
container:
image: public.ecr.aws/g6m3a0y9/landscape2
options: --user root
steps:
- name: Install git
run: apk add git
- name: Checkout this repository
uses: actions/checkout@v4
- name: Build landscape
run: |
landscape2 build \
--settings-file ./settings.yml \
--guide-file ./guide.yml \
--data-file ./data.yml \
--logos-path ./logos \
--output-dir /tmp/landscape
env:
# Required by landscape to the build using github data, and I can't have env vars that start with GITHUB_....
GITHUB_TOKENS: ${{ secrets.GITHUB_TOKEN }}
- name: Commit built landscape to build branch
run: |
git config --global safe.directory `pwd`
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
git fetch origin build:build
git checkout build
git branch --set-upstream-to=origin/build build
git pull
rm -rf *
cp -R /tmp/landscape/* .
cp index.html 404.html
git add .
git commit -m "Build landscape"
git push origin build