From 7cf1ab8250499168095bcdb42010bfcf955f145e Mon Sep 17 00:00:00 2001 From: Stefan Seifert Date: Mon, 10 Jul 2023 18:34:43 +0200 Subject: [PATCH] use properties from package.json instead of environment variable for appDeployName --- .github/workflows/build.yml | 2 +- .github/workflows/deploy.yml | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c2f3472..5b14c7e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ jobs: with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Read version from package.json + - name: Read properties from package.json id: package_json uses: zoexx/github-action-json-file-properties@1.0.4 with: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6d39753..ec5670a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -11,11 +11,17 @@ jobs: runs-on: ubuntu-latest environment: name: Production - url: "https://brdgm.me/${{ vars.APP_NAME }}" + url: "https://brdgm.me/${{ steps.package_json.outputs.appDeployName }}" steps: - uses: actions/checkout@v3 + - name: Read properties from package.json + id: package_json + uses: zoexx/github-action-json-file-properties@1.0.4 + with: + file_path: package.json + - uses: actions/setup-node@v3 with: node-version: 18 @@ -37,5 +43,5 @@ jobs: user-email: ${{ secrets.GH_SITE_DEPLOY_EMAIL }} user-name: ${{ secrets.GH_SITE_DEPLOY_NAME }} target-branch: main - commit-message: deploy ${{ vars.APP_NAME }} - target-directory: ${{ vars.APP_NAME }} + commit-message: deploy ${{ steps.package_json.outputs.appDeployName }} ${{ steps.package_json.outputs.version }} + target-directory: ${{ steps.package_json.outputs.appDeployName }}