Skip to content

style(admin): 어드민 레이아웃 버그 수정 (#214) #25

style(admin): 어드민 레이아웃 버그 수정 (#214)

style(admin): 어드민 레이아웃 버그 수정 (#214) #25

name: deploy-admin-production
on:
push:
branches:
- main
paths:
- "apps/admin/**"
jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }}
DOCKER_REPOSITORY: ${{ secrets.DOCKER_USER }}/jirum-alarm-admin
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
INFRA_GITHUB_REPOSITORY: ${{ secrets.INFRA_GITHUB_REPOSITORY }}
INFRA_GITHUB_REPOSITORY_DEPLOY_FILE_PATH: ${{ secrets.INFRA_GITHUB_REPOSITORY_DEPLOY_FILE_PATH }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install pnpm
uses: pnpm/action-setup@v4
# with:
# version: 8
- name: Get version
id: image
run: |
VERSION=$(echo ${{ github.sha }} | cut -c1-8)
echo VERSION=$VERSION
echo "::set-output name=version::$VERSION"
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install packages
run: pnpm install
- name: Docker private registry setting
run: |
echo $DOCKER_PASSWORD | docker login $DOCKER_REGISTRY -u $DOCKER_USER --password-stdin
- name: Build Image & Push Image
run: |
docker build -t $DOCKER_REGISTRY/$DOCKER_REPOSITORY:$IMAGE_TAG -f apps/admin/deploy/production/Dockerfile .
docker tag $DOCKER_REGISTRY/$DOCKER_REPOSITORY:$IMAGE_TAG $DOCKER_REGISTRY/$DOCKER_REPOSITORY:production
docker push $DOCKER_REGISTRY/$DOCKER_REPOSITORY:$IMAGE_TAG
docker push $DOCKER_REGISTRY/$DOCKER_REPOSITORY:production
echo "::set-output name=image::$DOCKER_REGISTRY/$DOCKER_REPOSITORY:$IMAGE_TAG"
env:
IMAGE_TAG: ${{ steps.image.outputs.version }}
- name: Checkout kubernetes infra repository
uses: actions/checkout@v4
with:
repository: ${{ env.INFRA_GITHUB_REPOSITORY }}
ref: main
token: ${{ secrets.ACTION_TOKEN }}
- name: Update Kubernetes Deployment resources
run: |
perl -i -pe's/image: harbor.kyojs.com\/tjsry0466\/jirum-alarm-admin:.*/image: harbor.kyojs.com\/tjsry0466\/jirum-alarm-admin:${{ steps.image.outputs.version }}/' production/$INFRA_GITHUB_REPOSITORY_DEPLOY_FILE_PATH
- name: Commit files
run: |
git config --global user.email "[email protected]"
git config --global user.name "github-actions"
git add .
git commit -am "Update image tag"
git push -u origin main
- name: action-slack
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
author_name: Github Bot (Production)
fields: repo,message
if_mention: success,failure
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: always()