Skip to content

Commit

Permalink
🚀 chore: 도커나이징 및 배포 워크플로우 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
kms0219kms committed Feb 13, 2024
1 parent 60bfb4a commit cef5daf
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Deploy Authorization Server

on:
push:
branches:
- master
workflow_dispatch:
workflow_call:

env:
IMAGE_NAME: spacewak_auth

jobs:
push:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4

- name: Build image
run: docker build . --file Dockerfile --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}"

- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin

- name: Push image
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM node:20-alpine

WORKDIR /usr/src/app

COPY .yarn ./.yarn
COPY .yarnrc.yml ./

COPY package.json ./
COPY yarn.lock ./

RUN yarn install --immutable

COPY . .

RUN yarn build

EXPOSE 4400
CMD [ "yarn", "node", "dist/src/main.js" ]
File renamed without changes.

0 comments on commit cef5daf

Please sign in to comment.