Skip to content

Commit

Permalink
STS-189 separate github workflow for building frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
max402 committed Jul 3, 2024
1 parent bc34b81 commit ba5771a
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 37 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Frontend build
on:
workflow_call:

jobs:

build_node:
name: Build & Test frontend
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./sts-client-example
steps:
- name: Step 1 - Checkout repository code
uses: actions/checkout@v4
with:
sparse-checkout: 'sts-client-example'
sparse-checkout-cone-mode: false

- name: Step 2 - setup node
uses: actions/setup-node@v4
with:
node-version: 20

- run: npm ci

- run: npm run prod

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: artifacts
path: |
${{ github.workspace }}/**/dist
overwrite: false
if-no-files-found: error
26 changes: 4 additions & 22 deletions .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- master

jobs:
build_java:
build-java:
name: Build & Test backend
runs-on: ubuntu-latest
steps:
Expand All @@ -29,24 +29,6 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true

build_angular:
name: Build & Test frontend
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./sts-client-example
steps:
- name: Step 1 - Checkout repository code
uses: actions/checkout@v4
with:
sparse-checkout: 'sts-client-example'
sparse-checkout-cone-mode: false

- name: Step 2 - setup node
uses: actions/setup-node@v4
with:
node-version: 20

- run: npm ci

- run: npm run prod
build-frontend:
uses: ./.github/workflows/frontend.yml
secrets: inherit
9 changes: 5 additions & 4 deletions .github/workflows/push-in-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ jobs:
- name: Step 3 - Build & Test
run: mvn clean verify -ntp

- name: Step 4 - Build client
run: ./scripts/build_client.sh

- name: Step 5 - Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
Expand All @@ -38,4 +35,8 @@ jobs:
GPG_EXECUTABLE: gpg
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
GPG_OWNERTRUST: ${{ secrets.GPG_OWNERTRUST }}
GPG_OWNERTRUST: ${{ secrets.GPG_OWNERTRUST }}

build-frontend:
uses: ./.github/workflows/frontend.yml
secrets: inherit
17 changes: 7 additions & 10 deletions .github/workflows/push-with-v-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- v*

jobs:
build:
build-java:
runs-on: ubuntu-latest
steps:
- name: Step 1 - Checkout repository code
Expand All @@ -28,24 +28,21 @@ jobs:
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
GPG_OWNERTRUST: ${{ secrets.GPG_OWNERTRUST }}

- name: Step 4 - setup node
uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm run prod

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: artifacts
path: |
${{ github.workspace }}/**/*.jar
${{ github.workspace }}/**/Dockerfile
overwrite: true
overwrite: false
if-no-files-found: error

build-frontend:
uses: ./.github/workflows/frontend.yml
secrets: inherit

dockerhub:
needs: build
needs: [build-java, build-frontend]
uses: ./.github/workflows/dockerhub.yml
secrets: inherit
2 changes: 1 addition & 1 deletion sts-client-example/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
FROM adorsys/nginx:ubi

COPY ./dist/ .
COPY docker/create_env.json.sh /docker-entrypoint.d/
COPY ./docker/create_env.json.sh /docker-entrypoint.d/

0 comments on commit ba5771a

Please sign in to comment.