Skip to content

feat: 초대장 수정, 삭제 기능 추가 #49

feat: 초대장 수정, 삭제 기능 추가

feat: 초대장 수정, 삭제 기능 추가 #49

Workflow file for this run

name: CI-Prod
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
permissions:
contents: read
actions: read
checks: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.SUBMODULE_TOKEN }}
submodules: true
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
- name: Build with Gradle
run: ./gradlew build -x test -Dspring.profiles.active=prod
- name: Test
run: ./gradlew test
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
*/build/test-results/test/TEST-*.xml
build/test-results/test/TEST-*.xml
check_name: "Test Results"
comment_mode: always
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up Docker BuildX
uses: docker/setup-buildx-action@v3
- name: Generate version tag
id: generate_tag
run: |
BUILD_DATE=$(date +'%Y%m%d')
RUN_ID=${{ github.run_id }}
SHORT_SHA=${GITHUB_SHA::7}
VERSION="${BUILD_DATE}-${RUN_ID}-${SHORT_SHA}"
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "PROD_LATEST_TAG=$VERSION" >> $GITHUB_ENV
- name: Store build info in Repository Secrets
env:
GH_TOKEN: ${{ secrets.PAT_TOKEN }}
run: |
echo "${{ env.PROD_LATEST_TAG }}" | gh secret set PROD_LATEST_TAG --repo ${{ github.repository }}
- name: Build and push
run: |
BASE_IMAGE="${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_PROD_IMAGE }}"
docker buildx build --platform linux/amd64 \
-t ${BASE_IMAGE}:latest \
-t ${BASE_IMAGE}:${{ env.VERSION }} \
--push .
- name: action-slack
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
author_name: serius-be
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
if_mention: failure,cancelled
channel: '#be-ci'
text: |
*빌드 상태*: ${{ job.status }}
*이미지 태그*: ${{ env.VERSION }}
*이미지 URL*: ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_PROD_IMAGE }}:${{ env.VERSION }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.CI_SLACK_WEBHOOK }}
if: always()