peytonplayz585-shadow-4.0/.github/workflows/build.yml

50 lines
1.4 KiB
YAML
Raw Normal View History

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
2024-06-04 11:01:36 -07:00
if: github.ref == 'refs/heads/main' # this is a temporary fix, and wont work on other branches; find a way to trigger on push and not pull request
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