From 2f72d244edb4e095167e724e4fb08862c5ec0a2e Mon Sep 17 00:00:00 2001 From: Christopher Berge Hove Date: Tue, 29 Oct 2024 11:41:45 +0100 Subject: [PATCH] chore: update app release actions --- .github/actions/get-fusion-token/action.yml | 5 +++++ .github/workflows/common-release.yml | 17 +++++------------ ...ml => deploy-portal-administration-ci.yml} | 19 ++++++------------- 3 files changed, 16 insertions(+), 25 deletions(-) rename .github/workflows/{deploy-apps-test.yml => deploy-portal-administration-ci.yml} (62%) diff --git a/.github/actions/get-fusion-token/action.yml b/.github/actions/get-fusion-token/action.yml index f2a218683..d32661ea1 100644 --- a/.github/actions/get-fusion-token/action.yml +++ b/.github/actions/get-fusion-token/action.yml @@ -30,3 +30,8 @@ runs: id: token shell: bash run: echo "token=$(az account get-access-token --resource '${{ inputs.resource-id }}' | jq '.accessToken')" >> $GITHUB_OUTPUT + + - name: "Set Token as Environment Variable" + shell: bash + run: | + echo "FUSION_TOKEN=${{ steps.token.outputs.token }}" >> $GITHUB_ENV diff --git a/.github/workflows/common-release.yml b/.github/workflows/common-release.yml index 940e8a148..a165ae8d9 100644 --- a/.github/workflows/common-release.yml +++ b/.github/workflows/common-release.yml @@ -136,25 +136,18 @@ jobs: with: node-version: "21" - - name: Install + - name: Install Global run: | cd client yarn install npm i -g @equinor/fusion-framework-cli - cd apps/portal-administration - yarn install - - name: Build + - name: Install run: | - cd client - yarn build:apps + cd apps/portal-administration + yarn install - name: Deploy run: | cd client/apps/portal-administration - yarn bundle - curl -T "app-bundle.zip" -H "Authorization: bearer ${{steps.get-fusion-token.outputs.token}}" -H "Content-Disposition: attachment; filename=app-bundle.zip" -H "Content-Type: application/zip" -X POST --show-error -i --url https://fusion-s-portal-fprd.azurewebsites.net/api/apps/portal-administration/versions - - - name: Publish - run: | - curl -H "Authorization: bearer ${{steps.get-fusion-token.outputs.token}}" -X POST --show-error -i --url https://fusion-s-portal-fprd.azurewebsites.net/api/apps/portal-administration/publish + fusion-framework-cli app build-publish -e fprd diff --git a/.github/workflows/deploy-apps-test.yml b/.github/workflows/deploy-portal-administration-ci.yml similarity index 62% rename from .github/workflows/deploy-apps-test.yml rename to .github/workflows/deploy-portal-administration-ci.yml index 43df29ccf..6d04a9858 100644 --- a/.github/workflows/deploy-apps-test.yml +++ b/.github/workflows/deploy-portal-administration-ci.yml @@ -1,4 +1,4 @@ -name: Deploy apps CI +name: Deploy portal-administration CI on: push: @@ -39,25 +39,18 @@ jobs: with: node-version: "21" - - name: Install + - name: Install Global run: | cd client yarn install npm i -g @equinor/fusion-framework-cli - cd apps/portal-administration - yarn install - - name: Build + - name: Install run: | - cd client - yarn build:apps + cd apps/portal-administration + yarn install - name: Deploy run: | cd client/apps/portal-administration - yarn bundle - curl -T "app-bundle.zip" -H "Authorization: bearer ${{steps.get-fusion-token.outputs.token}}" -H "Content-Disposition: attachment; filename=app-bundle.zip" -H "Content-Type: application/zip" -X POST --show-error -i --url https://fusion-s-portal-ci.azurewebsites.net/api/apps/portal-administration/versions - - - name: Publish - run: | - curl -H "Authorization: bearer ${{steps.get-fusion-token.outputs.token}}" -X POST --show-error -i --url https://fusion-s-portal-ci.azurewebsites.net/api/apps/portal-administration/publish + fusion-framework-cli app build-publish -e ci