-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature. updata action for ft service
- Loading branch information
Showing
1 changed file
with
46 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,49 +3,57 @@ on: | |
push: | ||
branches: | ||
- main | ||
- 'release**' | ||
- "release**" | ||
- ft | ||
env: | ||
SERVICE: tks-contract | ||
TARGET: cicd | ||
TAG: ${{github.sha}} | ||
|
||
jobs: | ||
build-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{secrets.DOCKERHUB_USERNAME}} | ||
password: ${{secrets.DOCKERHUB_TOKEN}} | ||
|
||
- name: Build and Push | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: true | ||
tags: | | ||
sktcloud/${{env.SERVICE}}:${{env.TAG}} | ||
- name: Setup Kustomize | ||
uses: imranismail/setup-kustomize@v1 | ||
with: | ||
kustomize-version: "3.6.1" | ||
- run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "tks" | ||
git clone "https://${{secrets.BOT_GITHUB_TOKEN}}@github.com/openinfradev/cicd-manifests.git" | ||
cd cicd-manifests/${SERVICE}/overlay/${TARGET} | ||
kustomize edit set image docker.io/sktcloud/${SERVICE}:${TAG} | ||
git add kustomization.yaml | ||
git commit --allow-empty -m "Set image tag to ${SERVICE} ${TAG}" | ||
git pull --rebase origin main | ||
git push origin main --force | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{secrets.DOCKERHUB_USERNAME}} | ||
password: ${{secrets.DOCKERHUB_TOKEN}} | ||
|
||
- name: Build and Push | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: true | ||
tags: | | ||
sktcloud/${{env.SERVICE}}:${{env.TAG}} | ||
- name: Setup Kustomize | ||
uses: imranismail/setup-kustomize@v1 | ||
with: | ||
kustomize-version: "3.6.1" | ||
- run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "tks" | ||
git clone "https://${{secrets.BOT_GITHUB_TOKEN}}@github.com/openinfradev/cicd-manifests.git" | ||
TARGET='cicd' | ||
if [[ ${{github.ref}} == *"develop"* ]]; then | ||
TARGET='development' | ||
elif [[ ${{github.ref}} == *"ft"* ]]; then | ||
TARGET='ft' | ||
fi | ||
cd cicd-manifests/${SERVICE}/overlay/${TARGET} | ||
kustomize edit set image docker.io/sktcloud/${SERVICE}:${TAG} | ||
git add kustomization.yaml | ||
git commit --allow-empty -m "Set image tag to ${SERVICE} ${TAG}" | ||
git pull --rebase origin main | ||
git push origin main --force |