49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
|
name: Build
|
||
|
on: [push, pull_request]
|
||
|
|
||
|
jobs:
|
||
|
build:
|
||
|
runs-on: ubuntu-latest
|
||
|
permissions:
|
||
|
contents: write
|
||
|
steps:
|
||
|
- name: Checkout repository
|
||
|
uses: actions/checkout@v4
|
||
|
- name: Setup java
|
||
|
uses: actions/setup-java@v4
|
||
|
with:
|
||
|
distribution: "temurin"
|
||
|
java-version: "21"
|
||
|
cache: "gradle"
|
||
|
- name: Validate Gradle wrapper
|
||
|
uses: gradle/actions/wrapper-validation@v3
|
||
|
- name: Compile code to javascript
|
||
|
run: ./gradlew generateJavaScript
|
||
|
- name: Compile assets
|
||
|
run: bash ./CompileEPK.sh
|
||
|
- name: Zip web files
|
||
|
run: zip -r web_files.zip javascript/*
|
||
|
- name: Upload github-pages artifact
|
||
|
if: github.ref == 'refs/heads/main'
|
||
|
uses: actions/upload-pages-artifact@v3
|
||
|
with:
|
||
|
path: javascript/
|
||
|
- name: Commit changes
|
||
|
uses: stefanzweifel/git-auto-commit-action@v5
|
||
|
|
||
|
deploy:
|
||
|
needs: build
|
||
|
if: github.ref == 'refs/heads/main'
|
||
|
concurrency:
|
||
|
group: "pages"
|
||
|
permissions:
|
||
|
pages: write
|
||
|
id-token: write
|
||
|
environment:
|
||
|
name: github-pages
|
||
|
url: ${{ steps.deployment.outputs.page_url }}
|
||
|
runs-on: ubuntu-latest
|
||
|
steps:
|
||
|
- name: Deploy to github pages
|
||
|
uses: actions/deploy-pages@v4
|