Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
Update release pipeline - there were issues in updating version
Browse files Browse the repository at this point in the history
  • Loading branch information
bartvanb committed Jan 29, 2024
1 parent ee55db2 commit 9329fec
Showing 1 changed file with 38 additions and 20 deletions.
58 changes: 38 additions & 20 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,10 @@ jobs:
if [[ $MAJOR == '3' ]]; then MAJOR_NAME="petronas"; fi
echo "major_name=${MAJOR_NAME}" >> $GITHUB_OUTPUT
outputs:
version: ${{ steps.split.outputs.version }}
stage: ${{ steps.split.outputs.stage }}
major_name: ${{ steps.split.outputs.major_name }}

# Build artifact for deployment
build:
name: Build deployment artifact
runs-on: ubuntu-latest
needs: version
env:
version: ${{ needs.version.outputs.version }}

steps:
- uses: actions/checkout@v3
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get branch on which the tag is based
id: branchname
Expand All @@ -67,24 +56,53 @@ jobs:
branch=$(echo $raw | sed 's/.*origin\///')
echo "branch=${branch}" >> $GITHUB_OUTPUT
- name: Checkout branch on which tag was pushed
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.branch }}
token: ${{ secrets.COMMIT_PAT }}

- name: Update UI version in package.json
env:
version: ${{ steps.split.outputs.version }}
run: |
npm version --no-git-tag-version --allow-same-version $version
- name: Set up Node.js version
uses: actions/setup-node@v1
with:
node-version: "20.x"

- name: Commit updated version
env:
version: ${{ steps.split.outputs.version }}
branch: ${{ steps.branchname.outputs.branch }}
run: |
git config --local user.name github-actions
git config --local user.email [email protected]
git add *
git commit -m "Updated the version to ${version}"
git push origin HEAD:$branch
outputs:
version: ${{ steps.split.outputs.version }}
stage: ${{ steps.split.outputs.stage }}
major_name: ${{ steps.split.outputs.major_name }}
branch: ${{ steps.branchname.outputs.branch }}

# Build artifact for deployment
build:
name: Build deployment artifact
runs-on: ubuntu-latest
needs: version
env:
version: ${{ needs.version.outputs.version }}
branch: ${{ needs.version.outputs.branch }}

steps:
- uses: actions/checkout@v3
with:
ref: ${{env.branch}}

- name: Set up Node.js version
uses: actions/setup-node@v1
with:
node-version: "20.x"

- name: npm install, build, and test
run: |
Expand Down

0 comments on commit 9329fec

Please sign in to comment.