Skip to content

Commit 981b6f1

Browse files
authored
JCL-350: Better use of GH Environments for CI/CD workflows (#457)
1 parent 91e77cf commit 981b6f1

2 files changed

Lines changed: 24 additions & 20 deletions

File tree

‎.github/workflows/cd-config.yml‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ on:
1111

1212
jobs:
1313
publish:
14-
name: Build and deploy
14+
name: Deploy artifacts
1515
runs-on: ubuntu-latest
16+
environment:
17+
name: "Sonatype"
1618

1719
steps:
1820
- uses: actions/checkout@v3
@@ -34,7 +36,7 @@ jobs:
3436

3537
- name: Deploy Artifacts
3638
run: mvn deploy -P publish
37-
if: github.actor != 'dependabot[bot]'
39+
if: ${{ github.actor != 'dependabot[bot]' }}
3840
env:
3941
MAVEN_REPO_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
4042
MAVEN_REPO_TOKEN: ${{ secrets.SONATYPE_TOKEN }}
@@ -46,6 +48,9 @@ jobs:
4648
site:
4749
name: Publish version-specific site
4850
runs-on: ubuntu-latest
51+
if: ${{ github.actor != 'dependabot[bot]' }}
52+
environment:
53+
name: "Github Pages"
4954

5055
steps:
5156
- uses: actions/checkout@v3
@@ -70,15 +75,14 @@ jobs:
7075
7176
- name: Publish tagged site to GitHub pages
7277
uses: peaceiris/actions-gh-pages@v3
73-
if: github.actor != 'dependabot[bot]' && startsWith(github.event.ref, 'refs/tags/inrupt-client')
78+
if: ${{ startsWith(github.event.ref, 'refs/tags/inrupt-client') }}
7479
with:
7580
keep_files: true
7681
publish_dir: ./target/staging/
7782
personal_token: ${{ secrets.GITHUB_TOKEN }}
7883

7984
- name: Publish versioned site to GitHub pages
8085
uses: peaceiris/actions-gh-pages@v3
81-
if: github.actor != 'dependabot[bot]'
8286
with:
8387
keep_files: true
8488
publish_dir: ./target/staging/

‎.github/workflows/ci-config.yml‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,9 @@ jobs:
88
build:
99
name: Java environment
1010
runs-on: ubuntu-latest
11-
environment:
12-
name: ${{ matrix.environment-name }}
13-
continue-on-error: ${{ matrix.experimental }}
1411
strategy:
1512
matrix:
16-
environment-name: ["ESS PodSpaces"]
1713
java: [ 11, 17 ]
18-
experimental: [false]
19-
include:
20-
- environment-name: "ESS DevNext"
21-
java: 11
22-
experimental: true
2314

2415
steps:
2516
- uses: actions/checkout@v3
@@ -34,15 +25,24 @@ jobs:
3425
- name: Build the code with Maven
3526
run: mvn -B -ntp install -Pci -pl -integration/uma,-integration/openid
3627

37-
- name: Integration tests (${{ matrix.environment-name }})
38-
run: mvn -B -ntp verify -Pci -pl integration/uma,integration/openid
28+
- name: Prod Integration tests
3929
if: ${{ github.actor != 'dependabot[bot]' }}
40-
# for integration tests
30+
run: mvn -B -ntp verify -Pci -pl integration/uma,integration/openid
31+
env:
32+
INRUPT_TEST_WEBID: ${{ secrets.INRUPT_PROD_WEBID }}
33+
INRUPT_TEST_PUBLIC_RESOURCE_PATH: ${{ secrets.INRUPT_PROD_PUBLIC_RESOURCE_PATH }}
34+
INRUPT_TEST_CLIENT_ID: ${{ secrets.INRUPT_PROD_CLIENT_ID }}
35+
INRUPT_TEST_CLIENT_SECRET: ${{ secrets.INRUPT_PROD_CLIENT_SECRET }}
36+
37+
- name: Dev Integration tests
38+
if: ${{ github.actor != 'dependabot[bot]' && matrix.java-version == 11 }}
39+
continue-on-error: true
40+
run: mvn -B -ntp verify -Pci -pl integration/uma,integration/openid
4141
env:
42-
inrupt.test-webid: ${{ secrets.INRUPT_TEST_WEBID }}
43-
inrupt.test.public-resource-path: ${{ secrets.INRUPT_TEST_PUBLIC_RESOURCE_PATH }}
44-
inrupt.test.client-id: ${{ secrets.INRUPT_TEST_CLIENT_ID }}
45-
inrupt.test.client-secret: ${{ secrets.INRUPT_TEST_CLIENT_SECRET }}
42+
INRUPT_TEST_WEBID: ${{ secrets.INRUPT_DEV_WEBID }}
43+
INRUPT_TEST_PUBLIC_RESOURCE_PATH: ${{ secrets.INRUPT_DEV_PUBLIC_RESOURCE_PATH }}
44+
INRUPT_TEST_CLIENT_ID: ${{ secrets.INRUPT_DEV_CLIENT_ID }}
45+
INRUPT_TEST_CLIENT_SECRET: ${{ secrets.INRUPT_DEV_CLIENT_SECRET }}
4646

4747
dependencies:
4848
name: Dependency Check

0 commit comments

Comments
 (0)