All checks were successful
Build And Test / build-and-push (push) Successful in 1m1s
- Replace read-file-action with shell command to properly trim newlines - Bump version to v0.0.4 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
68 lines
1.9 KiB
YAML
68 lines
1.9 KiB
YAML
name: Build And Test
|
|
|
|
run-name: ${{ gitea.actor }} is runs ci pipeline
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: checkout source code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Retrieve version
|
|
id: img-ver
|
|
run: echo "content=$(cat ./version | tr -d '\n')" >> $GITHUB_OUTPUT
|
|
|
|
- name: Install Docker
|
|
run: |
|
|
curl -fsSL https://get.docker.com -o get-docker.sh
|
|
sh get-docker.sh
|
|
if: runner.os == 'Linux'
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Login to Registry
|
|
run: docker login -u ${{ secrets.DOCKER_ID }} -p ${{ secrets.DOCKER_PW }} https://harbor.icurfer.com
|
|
|
|
- name: build
|
|
run: docker build -t harbor.icurfer.com/msa-demo/msa-django-nhn:${{ steps.img-ver.outputs.content }} .
|
|
|
|
- name: Push to Docker
|
|
run: docker push harbor.icurfer.com/msa-demo/msa-django-nhn:${{ steps.img-ver.outputs.content }}
|
|
|
|
## pre cd
|
|
- name: Setup Kustomize
|
|
uses: yokawasa/action-setup-kube-tools@v0.9.2
|
|
with:
|
|
kustomize: "3.7.0"
|
|
|
|
- name: Checkout kustomize repository
|
|
uses: actions/checkout@v3
|
|
with:
|
|
repository: "dev/cd-msa-django-nhn"
|
|
ref: main
|
|
token: ${{ secrets.ACTION_TOKEN }}
|
|
path: cd-msa-django-nhn
|
|
|
|
- name: Update Kubernetes resources
|
|
run: |
|
|
cd cd-msa-django-nhn/overlays/dev/
|
|
kustomize edit set image harbor.icurfer.com/msa-demo/msa-django-nhn:${{ steps.img-ver.outputs.content }}
|
|
cat kustomization.yaml
|
|
|
|
## cd commit
|
|
- name: Commit files
|
|
run: |
|
|
cd cd-msa-django-nhn
|
|
git config --global user.email "icurfer@gmail.com"
|
|
git config --global user.name "icurfer"
|
|
git commit -am "Update image tag"
|
|
git push -u origin main
|