feat: 부원 직책 다대다 지원 및 직책 마스터/조회 API 추가 #54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy | |
| on: | |
| push: | |
| branches: [main] | |
| concurrency: | |
| group: deploy-production | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-24.04-arm | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: true | |
| platforms: linux/arm64 | |
| tags: | | |
| ghcr.io/bcsdlab/bcsd-internal-api:latest | |
| ghcr.io/bcsdlab/bcsd-internal-api:${{ github.sha }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Deploy to server | |
| uses: appleboy/ssh-action@v1.0.3 | |
| with: | |
| host: ${{ secrets.DEPLOY_HOST }} | |
| port: ${{ secrets.DEPLOY_PORT }} | |
| username: ${{ secrets.DEPLOY_USER }} | |
| key: ${{ secrets.DEPLOY_SSH_KEY }} | |
| script: | | |
| echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
| docker pull ghcr.io/bcsdlab/bcsd-internal-api:latest | |
| docker stop bcsd-internal-api || true | |
| docker rm bcsd-internal-api || true | |
| docker run -d \ | |
| --name bcsd-internal-api \ | |
| --restart unless-stopped \ | |
| --network bcsdlab-internal_default \ | |
| -p 127.0.0.1:8081:8081 \ | |
| -e SERVER_PORT=8081 \ | |
| -e DB_HOST=bcsdlab-internal-postgres \ | |
| -e DB_PORT=5432 \ | |
| -e DB_NAME=bcsdlab_internal \ | |
| -e DB_USERNAME=bcsdlab_internal \ | |
| -e DB_PASSWORD='${{ secrets.DB_PASSWORD }}' \ | |
| -e JWT_SECRET='${{ secrets.JWT_SECRET }}' \ | |
| -e SWAGGER_SERVER_URL='${{ secrets.API_ORIGIN }}' \ | |
| -e RESET_PASSWORD_BASE_URL='${{ secrets.RESET_PASSWORD_BASE_URL }}' \ | |
| -e LOGIN_PAGE_URL='${{ secrets.LOGIN_PAGE_URL }}' \ | |
| -e MAIL_TRANSPORT=ses \ | |
| -e AWS_ACCESS_KEY_ID='${{ secrets.AWS_ACCESS_KEY_ID }}' \ | |
| -e AWS_SECRET_ACCESS_KEY='${{ secrets.AWS_SECRET_ACCESS_KEY }}' \ | |
| -e AWS_S3_BUCKET='${{ secrets.AWS_S3_BUCKET }}' \ | |
| -e AWS_S3_REGION='${{ secrets.AWS_S3_REGION }}' \ | |
| -e CORS_ALLOWED_ORIGINS='${{ secrets.CORS_ALLOWED_ORIGINS }}' \ | |
| -e GAME_BUILD_UPLOAD_URL='https://bcsdlab.com/api/games/builds/upload' \ | |
| -e GAME_BUILD_SECRET='${{ secrets.GAME_BUILD_SECRET }}' \ | |
| -e GAME_BUILD_PUBLIC_ORIGIN='https://bcsdlab.com' \ | |
| --memory=300m \ | |
| ghcr.io/bcsdlab/bcsd-internal-api:latest |