Skip to content

Commit 36335ca

Browse files
committed
refactor pull-request and main jobs
Signed-off-by: Andre Bossert <anb0s@anbos.de>
1 parent f35449d commit 36335ca

File tree

2 files changed

+27
-19
lines changed

2 files changed

+27
-19
lines changed

.github/workflows/main.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
3+
4+
name: Main
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
11+
jobs:
12+
13+
deploy-testing:
14+
if: contains(github.event.head_commit.message, 'testing build')
15+
runs-on: ubuntu-latest
16+
needs: [platform]
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Deploy for Testing
20+
uses: JamesIves/github-pages-deploy-action@v4
21+
with:
22+
branch: gh-pages
23+
folder: site/updates
24+
clean: false
Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
33

4-
name: Pull-Request or Main
4+
name: Pull-Request
55

66
on:
7-
push:
8-
branches:
9-
- main
107
pull_request:
118
branches:
129
- main
@@ -33,24 +30,11 @@ jobs:
3330
- name: 'Build for platform: ${{ matrix.target-platform }}'
3431
run: 'mvn -Dtarget.platform=${{ matrix.target-platform }} -Dsite.dir=testing clean verify'
3532
- name: Assign build.version.properties to env variable
36-
if: github.event_name == 'pull_request' && matrix.target-platform == env.DEFAULT_TARGET_PLATFORM && !contains(github.head_ref, 'staging')
33+
if: matrix.target-platform == env.DEFAULT_TARGET_PLATFORM
3734
run: cat site/target/build.version.properties >> $GITHUB_ENV
3835
- name: 'Deploy build ${{ env.build_version_full }} for PR${{ github.event.pull_request.number }}'
39-
if: github.event_name == 'pull_request' && matrix.target-platform == env.DEFAULT_TARGET_PLATFORM && !contains(github.head_ref, 'staging')
36+
if: matrix.target-platform == env.DEFAULT_TARGET_PLATFORM
4037
uses: actions/upload-artifact@v2
4138
with:
4239
name: EasyShell-${{ env.build_version_full }}
4340
path: site/target/repository
44-
45-
deploy-testing:
46-
if: github.event_name == 'pull_request' && contains(github.head_ref, 'staging')
47-
runs-on: ubuntu-latest
48-
needs: [platform]
49-
steps:
50-
- uses: actions/checkout@v2
51-
- name: Deploy for Testing
52-
uses: JamesIves/github-pages-deploy-action@v4
53-
with:
54-
branch: gh-pages
55-
folder: site/updates
56-
clean: false

0 commit comments

Comments
 (0)