diff --git a/.github/workflows/web_build.yml b/.github/workflows/web_build.yml index fb20d1c..cde4421 100644 --- a/.github/workflows/web_build.yml +++ b/.github/workflows/web_build.yml @@ -1,32 +1,43 @@ -name: Build +name: WebDeployment on: push: branches: - main - pull_request: - workflow_dispatch: env: - CI: + CI: true jobs: build: name: Build runs-on: macos-13 steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v3 + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Set up Java + uses: actions/setup-java@v3 with: distribution: 'zulu' java-version: '17' - - uses: gradle/wrapper-validation-action@v1 - - uses: gradle/gradle-build-action@v2 - - name: Build + + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v1 + + - name: Build with Gradle run: ./gradlew :webApp:jsBrowserProductionWebpack - - name: Upload Build Artifact - if: github.ref == 'refs/heads/main' - uses: actions/upload-artifact@v2 - with: - name: my-app-artifact - path: desktopApp/build/libs/my-app.jar + + - name: Move Output to Directory + run: | + mkdir distribution + mv -r webApp/build/distributions distribution/ + + # Commit and push the directory to a specified branch (e.g., "output-branch") + - name: Commit and Push to Branch + run: | + git config user.name "GitHub Actions" + git config user.email "actions@github.com" + git add distribution/ + git commit -m "Add output from build" + git push origin HEAD:deploy-branch \ No newline at end of file