deploy.yaml (1301B)
1 name: Build and deploy 2 3 on: 4 push: 5 branches: 6 - main 7 workflow_dispatch: 8 9 jobs: 10 # Build job 11 build: 12 runs-on: ubuntu-latest 13 defaults: 14 run: 15 shell: bash 16 steps: 17 - uses: actions/checkout@v3 18 - uses: actions/setup-java@v3 19 with: 20 distribution: temurin 21 java-version: 19 22 - name: Setup Gradle 23 uses: gradle/gradle-build-action@v2 24 - name: Run export 25 run: | 26 ./gradlew jsBrowserProductionWebpack 27 - name: Upload Pages artifact 28 uses: actions/upload-pages-artifact@v2 29 with: 30 path: build/dist/js/productionExecutable/ 31 retention-days: 1 32 # Deploy job 33 deploy: 34 # Add a dependency to the build job 35 needs: build 36 37 # Grant GITHUB_TOKEN the permissions required to make a Pages deployment 38 permissions: 39 pages: write # to deploy to Pages 40 id-token: write # to verify the deployment originates from an appropriate source 41 42 # Deploy to the github-pages environment 43 environment: 44 name: github-pages 45 url: ${{ steps.deployment.outputs.page_url }} 46 47 # Specify runner + deployment step 48 runs-on: ubuntu-latest 49 steps: 50 - name: Deploy to GitHub Pages 51 id: deployment 52 uses: actions/deploy-pages@v2