diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml new file mode 100644 index 00000000..18eeead1 --- /dev/null +++ b/.github/workflows/frontend.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/pull-requests.yml b/.github/workflows/pull-requests.yml index fe317259..dea49628 100644 --- a/.github/workflows/pull-requests.yml +++ b/.github/workflows/pull-requests.yml @@ -6,7 +6,7 @@ on: - master jobs: - build_java: + build-java: name: Build & Test backend runs-on: ubuntu-latest steps: @@ -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 \ No newline at end of file + build-frontend: + uses: ./.github/workflows/frontend.yml + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/push-in-develop.yml b/.github/workflows/push-in-develop.yml index 2718b5e1..adf23b2d 100644 --- a/.github/workflows/push-in-develop.yml +++ b/.github/workflows/push-in-develop.yml @@ -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: @@ -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 }} \ No newline at end of file + GPG_OWNERTRUST: ${{ secrets.GPG_OWNERTRUST }} + + build-frontend: + uses: ./.github/workflows/frontend.yml + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/push-with-v-tag.yml b/.github/workflows/push-with-v-tag.yml index ee891956..ae91b005 100644 --- a/.github/workflows/push-with-v-tag.yml +++ b/.github/workflows/push-with-v-tag.yml @@ -5,7 +5,7 @@ on: - v* jobs: - build: + build-java: runs-on: ubuntu-latest steps: - name: Step 1 - Checkout repository code @@ -28,13 +28,6 @@ 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: @@ -42,10 +35,14 @@ jobs: 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 \ No newline at end of file diff --git a/sts-client-example/Dockerfile b/sts-client-example/Dockerfile index ca116e28..1c98f180 100644 --- a/sts-client-example/Dockerfile +++ b/sts-client-example/Dockerfile @@ -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/