Skip to content

Merge pull request #44 from letskuku/letskuku #2

Merge pull request #44 from letskuku/letskuku

Merge pull request #44 from letskuku/letskuku #2

Workflow file for this run

name: deploy
on:
push:
branches:
- 'letskuku'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: make application.yml
run: |
cd ./src/main
mkdir resources
touch ./application.yml
echo "${{ secrets.PROPERTIES }}" > ./application.yml
shell: bash
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
shell: bash
- name: Build with Gradle
run: |
./gradlew -version
./gradlew clean build -x test
shell: bash
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name : Build Docker Image & Push to Docker Hub
run: |
docker build . -t ${{ secrets.DOCKER_HUB_USERNAME }}/spring-daagn-market-18th
docker build ./proxy -t ${{ secrets.DOCKER_HUB_USERNAME }}/nginx
docker push ${{ secrets.DOCKER_HUB_USERNAME }}/spring-daagn-market-18th
docker push ${{ secrets.DOCKER_HUB_USERNAME }}/nginx
- name: Get current time
uses: 1466587594/get-current-time@v2
id: current-time
with:
format: YYYY-MM-DDTHH-mm-ss
utcOffset: "+09:00"
- name: Deploy to EB
uses: einaregilsson/beanstalk-deploy@v18
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: spring-daagn-market-18th
environment_name: Spring-daagn-market-18th-env
version_label: deploy-${{steps.current-time.outputs.formattedTime}}
region: ap-northeast-2
deployment_package: ./docker-compose.yml