Skip to content

Commit

Permalink
#70 image가 배포되면 helm chart로 pr 날리도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
hanjoo96.cho committed Jun 8, 2024
1 parent ed61efe commit 402e56d
Showing 1 changed file with 7 additions and 52 deletions.
59 changes: 7 additions & 52 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,73 +20,28 @@ jobs:
with:
java-version: 11

- name: Cache SonarQube packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Cache Gradle packages
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

- name: Docker Login
run: echo "${{ secrets.TOKEN }}" | docker login ghcr.io -u ${{ secrets.USERNAME }} --password-stdin

- name: Build with Gradle
env:
USERNAME: ${{secrets.USERNAME}}
TOKEN: ${{secrets.TOKEN}}
GITHUB_TOKEN: ${{ secrets.TOKEN }} # Needed to get PR information, if any
run: ./gradlew clean test jacocoTestReport --stacktrace --profile

- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}

- name: Set Current Time
uses: 1466587594/get-current-time@v1
id: current-time
with:
format: YYYY.MM
utcOffset: "+09:00"
if: always()

- name: Build with Gradle and Jib
env:
VERSION: "${{ steps.current-time.outputs.formattedTime }}.${{github.run_number}}"
USERNAME: ${{secrets.USERNAME}}
TOKEN: ${{secrets.TOKEN}}
GITHUB_TOKEN: ${{ secrets.TOKEN }} # Needed to get PR information, if any
run: ./gradlew :api:jib

cd:
needs: [ci]
runs-on: ubuntu-latest
steps:
- name: Checkout tools repo
uses: actions/checkout@v3
with:
repository: ssu-commerce/helm-charts
path: chart/ssu-commerce
fetch-depth: 0

- name: List files for debugging
run: ls -la /home/runner/work/book-server/book-server/helm-charts/chart/ssu-commerce

- name: Update Image Version in the related HelmChart values.yaml
uses: fjogeleit/yaml-update-action@main
with:
valueFile: 'chart/ssu-commerce/values.yaml'
propertyPath: 'book.image.tag'
value: "${{ steps.current-time.outputs.formattedTime }}.${{github.run_number}}"
value: "2024.06.69"
repository: ssu-commerce/helm-charts
branch: deployment/${{ steps.current-time.outputs.formattedTime }}.${{github.run_number}}
branch: deployment/2024.06.69
targetBranch: main
createPR: true
message: 'Update Image Version to "${{ steps.current-time.outputs.formattedTime }}.${{github.run_number}}"'
message: 'Update Image Version to 2024.06.69'
token: ${{ secrets.TOKEN }}
workDir: helm-charts
# - name: Push helm repo
Expand Down

0 comments on commit 402e56d

Please sign in to comment.