-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Michael Jordan
committed
Oct 25, 2023
1 parent
215eac5
commit c47e0ef
Showing
1 changed file
with
26 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 "[email protected]" | ||
git add distribution/ | ||
git commit -m "Add output from build" | ||
git push origin HEAD:deploy-branch |