Skip to content

Commit

Permalink
Merge pull request #549 from openinfradev/harbor
Browse files Browse the repository at this point in the history
test
  • Loading branch information
ktkfree authored Nov 11, 2024
2 parents 5a5e500 + 01fd85f commit eee19ec
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
env:
SERVICE: tks-api
TAG: ${{github.sha}}
REGISTRY: harbor.taco-cat.xyz

jobs:
build-deploy:
Expand All @@ -24,6 +25,7 @@ jobs:
- name: Login to DockerHub
uses: docker/login-action@v1
with:
registry: ${{REGISTRY}}
username: ${{secrets.HARBOR_USERNAME}}
password: ${{secrets.HARBOR_SECRET}}

Expand All @@ -33,7 +35,7 @@ jobs:
with:
push: true
tags: |
sktcloud/${{env.SERVICE}}:${{env.TAG}}
tks/${{env.SERVICE}}:${{env.TAG}}
- name: Setup Kustomize
uses: imranismail/setup-kustomize@v1
Expand All @@ -46,12 +48,12 @@ jobs:
git clone "https://${{secrets.BOT_GITHUB_TOKEN}}@github.com/openinfradev/cicd-manifests.git"
if [[ ${{github.ref}} == *"develop"* ]]; then
( cd cicd-manifests/${SERVICE}/overlay/development && kustomize edit set image docker.io/sktcloud/${SERVICE}:${TAG} && git add kustomization.yaml )
( cd cicd-manifests/${SERVICE}/overlay/development && kustomize edit set image ${REGISTRY}/tks/${SERVICE}:${TAG} && git add kustomization.yaml )
elif [[ ${{github.ref}} == *"release"* ]]; then
( cd cicd-manifests/${SERVICE}/overlay/ft && kustomize edit set image docker.io/sktcloud/${SERVICE}:${TAG} && git add kustomization.yaml )
( cd cicd-manifests/${SERVICE}/overlay/ft && kustomize edit set image ${REGISTRY}/tks/${SERVICE}:${TAG} && git add kustomization.yaml )
elif [[ ${{github.ref}} == *"main"* ]]; then
( cd cicd-manifests/${SERVICE}/overlay/cicd && kustomize edit set image docker.io/sktcloud/${SERVICE}:${TAG} && git add kustomization.yaml )
( cd cicd-manifests/${SERVICE}/overlay/prd && kustomize edit set image docker.io/sktcloud/${SERVICE}:${TAG} && git add kustomization.yaml )
( cd cicd-manifests/${SERVICE}/overlay/cicd && kustomize edit set image ${REGISTRY}/tks/${SERVICE}:${TAG} && git add kustomization.yaml )
( cd cicd-manifests/${SERVICE}/overlay/prd && kustomize edit set image ${REGISTRY}/tks/${SERVICE}:${TAG} && git add kustomization.yaml )
fi
cd cicd-manifests
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
env:
SERVICE: tks-api
TAG: ${{github.sha}}
REGISTRY: harbor.taco-cat.xyz

jobs:
build-image:
Expand All @@ -25,6 +26,7 @@ jobs:
- name: Login to DockerHub
uses: docker/login-action@v1
with:
registry: ${{REGISTRY}}
username: ${{secrets.HARBOR_USERNAME}}
password: ${{secrets.HARBOR_SECRET}}

Expand All @@ -34,4 +36,4 @@ jobs:
with:
push: false
tags: |
sktcloud/${{env.SERVICE}}:${{env.TAG}}
tks/${{env.SERVICE}}:${{env.TAG}}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,5 @@ roleRef:
name: tks-api
apiGroup: rbac.authorization.k8s.io
```


0 comments on commit eee19ec

Please sign in to comment.