Skip to content

new-tag-created

new-tag-created #36

Workflow file for this run

name: Deploy to GitHub Pages
on:
repository_dispatch:
types: [new-tag-created]
# push:
# tags: [v*.*.*]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check current branch
run: |
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
echo "Current branch: $CURRENT_BRANCH"
if [ "$CURRENT_BRANCH" != "main" ]; then
echo "Error: Workflow must run on the main branch"
exit 1
fi
- name: Setup Godot
uses: lihop/setup-godot@v2
with:
version: 4.3
export-templates: true
- name: Export project to web
run: |
mkdir -p build/web
godot --headless --export-release "Web" build/web/index.html
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: success()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/web