Merge pull request #520 from OpenBankingToolkit/982-investigate-oom-i… #337
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
name: Build-UI | |
on: | |
pull_request: | |
branches: | |
- master | |
paths: | |
- "forgerock-openbanking-ui/**" | |
push: | |
branches: | |
- master | |
env: | |
GITHUB_SHA: ${{ github.sha }} | |
jobs: | |
prepare: | |
name: Prepare | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v2 | |
- name: setup node version 10 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '10' | |
- name: Run tests | |
working-directory: ./forgerock-openbanking-ui | |
run: | | |
npm ci | |
npm run test.ci | |
./node_modules/@angular/cli/bin/ng lint | |
- name: Prepare customers | |
working-directory: ./forgerock-openbanking-ui | |
run: git clone https://${{ secrets.FORGECLOUD_ACCESS_TOKEN }}@github.com/ForgeCloud/ob-customers.git customers | |
- name: Archive Production Artifact | |
uses: actions/upload-artifact@master | |
with: | |
name: customers | |
path: forgerock-openbanking-ui/customers | |
build_bank_ui: | |
name: Build Bank App | |
runs-on: ubuntu-latest | |
needs: prepare | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v2 | |
- name: prepare version | |
id: version | |
run: | | |
echo "::set-output name=BUILD_VERSION::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)-${GITHUB_SHA::7}" | |
- name: Download Artifact | |
uses: actions/download-artifact@master | |
with: | |
name: customers | |
path: forgerock-openbanking-ui/customers | |
- working-directory: ./forgerock-openbanking-ui | |
run: cp -R ./customers/* themes/ | |
- name: Build bank docker image | |
working-directory: ./forgerock-openbanking-ui | |
run: | | |
echo "Building docker image eu.gcr.io/openbanking-214714/obri/bank-ui:${{ steps.version.outputs.BUILD_VERSION }}" | |
echo "${{ secrets.GCR_JSON_KEY_BASE64 }}" | base64 -d | docker login eu.gcr.io -u _json_key --password-stdin | |
docker build --build-arg BUILD_VERSION=${{ steps.version.outputs.BUILD_VERSION }} -f projects/bank/docker/Dockerfile -t eu.gcr.io/openbanking-214714/obri/bank-ui:latest -t eu.gcr.io/openbanking-214714/obri/bank-ui:${{ steps.version.outputs.BUILD_VERSION }} . | |
docker push eu.gcr.io/openbanking-214714/obri/bank-ui:latest | |
docker push eu.gcr.io/openbanking-214714/obri/bank-ui:${{ steps.version.outputs.BUILD_VERSION }} | |
build_manual_onboarding: | |
name: Build Register App | |
runs-on: ubuntu-latest | |
needs: prepare | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v2 | |
- name: prepare version | |
id: version | |
run: | | |
echo "::set-output name=BUILD_VERSION::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)-${GITHUB_SHA::7}" | |
- name: Download Artifact | |
uses: actions/download-artifact@master | |
with: | |
name: customers | |
path: forgerock-openbanking-ui/customers | |
- working-directory: ./forgerock-openbanking-ui | |
run: cp -R ./customers/* themes/ | |
- name: Build register docker image | |
working-directory: ./forgerock-openbanking-ui | |
run: | | |
echo "Building docker image eu.gcr.io/openbanking-214714/obri/manual-onboarding:${{ steps.version.outputs.BUILD_VERSION }}" | |
echo "${{ secrets.GCR_JSON_KEY_BASE64 }}" | base64 -d | docker login eu.gcr.io -u _json_key --password-stdin | |
docker build --build-arg BUILD_VERSION=${{ steps.version.outputs.BUILD_VERSION }} -f projects/manual-onboarding/docker/Dockerfile -t eu.gcr.io/openbanking-214714/obri/manual-onboarding:latest -t eu.gcr.io/openbanking-214714/obri/manual-onboarding:${{ steps.version.outputs.BUILD_VERSION }} . | |
docker push eu.gcr.io/openbanking-214714/obri/manual-onboarding:latest | |
docker push eu.gcr.io/openbanking-214714/obri/manual-onboarding:${{ steps.version.outputs.BUILD_VERSION }} | |
update_ob_deploy: | |
name: Update ob-deploy | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' | |
needs: [build_manual_onboarding, build_bank_ui] | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v2 | |
- name: prepare version | |
id: version | |
run: | | |
echo "::set-output name=BUILD_VERSION::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)-${GITHUB_SHA::7}" | |
- name: Checkout Repo | |
uses: actions/checkout@v2 | |
with: | |
repository: "forgeCloud/ob-deploy" | |
token: ${{ secrets.FORGECLOUD_ACCESS_TOKEN }} | |
path: ob-deploy | |
- name: Commit ob-deploy version update | |
if: github.ref == 'refs/heads/master' | |
working-directory: ./ob-deploy | |
run: | | |
jq -M '[ .[] | if ((.service == "bank-ui" or .service == "manual-onboarding") and (.helmReference | contains("obri-helm-charts/ui-template"))) then .version |= "${{ steps.version.outputs.BUILD_VERSION }}" else . end ]' client_releases/master-dev/releases.json > client_releases/master-dev/releases.json.tmp | |
mv client_releases/master-dev/releases.json.tmp client_releases/master-dev/releases.json | |
git config --global user.email "codefresh@codefresh.io" | |
git config --global user.name "Codefresh" | |
git add client_releases/master-dev/releases.json | |
git commit --allow-empty -m "Bumping Bank & Register UI version ${{ steps.version.outputs.BUILD_VERSION }}" | |
- name: Temporarily disable "include administrators" protection | |
id: disable_include_admins | |
uses: benjefferies/branch-protection-bot@1.0.9 | |
if: always() | |
with: | |
access_token: ${{ secrets.FORGECLOUD_ACCESS_TOKEN }} | |
enforce_admins: false | |
owner: forgeCloud | |
repo: ob-deploy | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.FORGECLOUD_ACCESS_TOKEN }} | |
directory: ./ob-deploy | |
repository: "forgeCloud/ob-deploy" | |
branch: master | |
- name: Enable "include administrators" branch protection | |
uses: benjefferies/branch-protection-bot@1.0.9 | |
if: always() | |
with: | |
access_token: ${{ secrets.FORGECLOUD_ACCESS_TOKEN }} | |
enforce_admins: ${{ steps.disable_include_admins.outputs.initial_status }} | |
owner: forgeCloud | |
repo: ob-deploy |