Building maps for commit a3ffb8da0a7b5881334e14e154ec8f5e0f62e83c by sergej-singer #21
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
# Direct from Repository | |
name: mapbuilder | |
run-name: Building maps for commit ${{ github.sha }} by ${{ github.actor }} | |
on: | |
push: | |
branches: | |
- "*" | |
- "*/**" | |
- "!main" | |
paths: | |
- 'mapdata/**' | |
permissions: write-all | |
jobs: | |
mapbuilder-build-maps: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo content | |
uses: actions/checkout@v4 # checkout the repository content | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.12" # install the python version needed | |
- name: Install poetry | |
uses: abatilo/actions-poetry@v2 | |
- name: Setup a local virtual environment (if no poetry.toml file) | |
run: | | |
poetry config virtualenvs.create true --local | |
poetry config virtualenvs.in-project true --local | |
- uses: actions/cache@v3 | |
name: Define a cache for the virtual environment based on the dependencies lock file | |
with: | |
path: ./.venv | |
key: venv-${{ hashFiles('poetry.lock') }} | |
- name: Install the project dependencies | |
working-directory: ./.github/workflows/mapbuilder | |
run: poetry install | |
- name: Execute script # run mapbuilder | |
working-directory: ./.github/workflows/mapbuilder | |
run: poetry run mapbuilder --debug -s "../../../mapdata" "../../../EDGG" | |
- name: Commit files | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add -A | |
git diff-index --quiet HEAD || (git commit -a -m "[AUTO] mapbuilder ${{ github.sha }}" --allow-empty) | |
- name: push changes | |
uses: ad-m/github-push-action@v0.6.0 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} | |
# via Docker | |
# name: mapbuilder | |
# run-name: Building maps for commit ${{ github.sha }} by ${{ github.actor }} | |
# on: | |
# push: | |
# branches: | |
# - "*" | |
# - "*/**" | |
# - "!main" | |
# paths: | |
# - 'mapdata/**' | |
# permissions: write-all | |
# jobs: | |
# build-maps: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - name: Restore cached sources | |
# uses: actions/cache/restore@v4 | |
# with: | |
# path: .cache | |
# key: sources | |
# - name: Run mapbuilder | |
# uses: sergej-singer/mapbuilder@edgg | |
# with: | |
# target-path: 'EDGG' | |
# source-path: 'mapdata' | |
# - name: Store cached sources | |
# uses: actions/cache/save@v4 | |
# with: | |
# path: .cache | |
# key: sources | |
# | |
# - name: Commit files | |
# run: | | |
# git config --local user.email "action@github.com" | |
# git config --local user.name "GitHub Action" | |
# git add -A | |
# git diff-index --quiet HEAD || (git commit -a -m "[AUTO] mapbuilder ${{ github.sha }}" --allow-empty) | |
# | |
# - name: push changes | |
# uses: ad-m/github-push-action@v0.6.0 | |
# with: | |
# github_token: ${{ secrets.GITHUB_TOKEN }} | |
# branch: ${{ github.ref }} |