Ändere den Workflow-Namen und füge einen Bereitstellungsschritt für s… #18
This file contains hidden or 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
| name: Build and Deploy to Static Repo | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Install ffmpeg | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y ffmpeg | |
| - name: Copy build config | |
| run: | | |
| cp workflowConfig.json buildtools_config.json | |
| - name: Run Build Script | |
| run: | | |
| chmod +x ./build.sh | |
| ./build.sh | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: eaglercraft-clients | |
| path: out/ | |
| deploy: | |
| # This job runs only after the 'build' job has successfully completed | |
| needs: build | |
| # This job should only run on a push to the main branch, not on pull requests | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: eaglercraft-clients | |
| path: out/ | |
| - name: Deploy to external repository | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| # The secret token you created | |
| personal_token: ${{ secrets.PAT }} | |
| # The repository to push to | |
| external_repository: StoppedwummPython/eageag | |
| # The directory to publish | |
| publish_dir: ./out | |
| # The branch to push to in the destination repository | |
| publish_branch: main | |
| # The commit user and email | |
| user_name: 'github-actions[bot]' | |
| user_email: 'github-actions[bot]@users.noreply.github.com' | |
| # A custom commit message | |
| commit_message: 'Automated deployment of static files' |