Skip to content

Commit

Permalink
Merge pull request #25 from Star-Academy/fixCI2
Browse files Browse the repository at this point in the history
feat: ci can change tag in helm now
  • Loading branch information
msm1984 authored Aug 27, 2024
2 parents ca3166a + 310c962 commit aa9b305
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion .github/workflows/CD_Backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ on:
jobs:
version-and-release:
runs-on: ubuntu-latest

outputs:
backimage_version: ${{ steps.tag_version.outputs.new_tag }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -58,3 +59,29 @@ jobs:
steps.tag_version.outputs.changelog
draft: false
prerelease: false
helm-update:
runs-on: ubuntu-latest
needs: [version-and-release]
steps:
- name: Clone Deployment Repository
uses: GuillaumeFalourd/[email protected]
with:
depth: 1
branch: 'main'
owner: 'Star-Academy'
repository: 'Summer1403-Project-Group01-Deployment'

- name: Update Angular Image Tag in Helm Chart
run: |
cd Summer1403-Project-Group01-Deployment/mychart
sed -i 's|image: mohammadsadeghmontazeri/starback:.*|image: mohammadsadeghmontazeri/starback:${{ needs.version-and-release.outputs.backimage_version }}|' values.yaml
sed -i 's|image: mohammadsadeghmontazeri/migratestar:.*|image: mohammadsadeghmontazeri/migratestar:${{ needs.version-and-release.outputs.backimage_version }}|' values.yaml
git config --global user.email "[email protected]"
git config --global user.name "msm1984"
git commit -am "Update webapp and migration image tag to ${{ needs.version-and-release.outputs.backimage_version }}"
- name: Push to Deployment Repository
run: |
cd Summer1403-Project-Group01-Deployment
git remote set-url origin https://x-access-token:${{ secrets.MYPAT }}@github.com/Star-Academy/Summer1403-Project-Group01-Deployment.git
git push

0 comments on commit aa9b305

Please sign in to comment.