Some checks failed
Build and Push Docker Image / build (push) Has been cancelled
- NHN Cloud API packages: token, vpc, compute, nks, storage - REST API endpoints with Swagger documentation - Async task processing for long-running operations - CORS configuration for frontend integration - Enhanced logging for debugging API calls Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
49 lines
1.5 KiB
YAML
49 lines
1.5 KiB
YAML
name: Build and Push Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout source code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Get version
|
|
id: version
|
|
run: echo "VERSION=$(cat version)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Harbor Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: harbor.icurfer.com
|
|
username: ${{ secrets.HARBOR_USERNAME }}
|
|
password: ${{ secrets.HARBOR_PASSWORD }}
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: harbor.icurfer.com/msa-demo/msa-django-nhn:${{ steps.version.outputs.VERSION }}
|
|
|
|
- name: Update Kubernetes manifests
|
|
run: |
|
|
git clone https://${{ secrets.GIT_USERNAME }}:${{ secrets.GIT_TOKEN }}@github.com/${{ github.repository_owner }}/cd-msa-django-nhn.git
|
|
cd cd-msa-django-nhn
|
|
sed -i "s|harbor.icurfer.com/msa-demo/msa-django-nhn:.*|harbor.icurfer.com/msa-demo/msa-django-nhn:${{ steps.version.outputs.VERSION }}|g" kustomize/overlays/dev/kustomization.yaml
|
|
git config user.name "GitHub Actions"
|
|
git config user.email "actions@github.com"
|
|
git add .
|
|
git commit -m "Update image tag to ${{ steps.version.outputs.VERSION }}" || echo "No changes to commit"
|
|
git push
|