Skip to content

Delete .DS_Store

Delete .DS_Store #8

Workflow file for this run

name: Build and Push to ECR (Prod)
on:
push:
branches:
- main # Change this to your desired branch
env:
REGION: ap-northeast-2 # Seoul
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
check-latest: true
- name: make application.yml
run: |
mkdir ./src/main/resources
cd ./src/main/resources
touch ./application.yml
echo "${{ secrets.YML }}" > ./application.yml
shell: bash
- name: make application-dev.yml
run: |
cd ./src/main/resources
touch ./application-dev.yml
echo "${{ secrets.YML_PROD }}" > ./application-dev.yml
cat ./application-dev.yml
shell: bash
- name: Setup Gradle 7.6
uses: gradle/gradle-build-action@v2
with:
gradle-version: 7.6
- name: Gradle Caching
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build Spring Boot application
run: gradle build
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.REGION }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build and tag Docker image
run: |
docker build -t ${{ secrets.ECR_REGISTRY }}/prod:latest .
- name: Push Docker image to ECR
run: |
docker push ${{ secrets.ECR_REGISTRY }}/prod:latest
# notification:
# needs: deploy
# runs-on: ubuntu-latest
#
# steps:
# - name: Send Discord Notification
# run: |
# curl -X POST \
# -H "Content-Type: application/json" \
# -d '{"username": "'"${GITHUB_ACTOR}"'", "content": "효근아 서버 올라갔어~"}' \
# ${{ secrets.DISCORD_WEBHOOK }}