Feat/13 profile #88
Workflow file for this run
This file contains 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: | |
- 'develop' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: write yml | |
run: | | |
cd ./src/main/resources | |
echo "${{ secrets.APPLICATION_YML }}" >> application.yml | |
- name: write aws | |
run: echo "${{ secrets.APPLICATION_AWS_YML }}" >> application-aws.yml | |
working-directory: ./src/main/resources | |
- name: write oauth | |
run: echo "${{ secrets.APPLICATION_OAUTH_YML }}" >> application-oauth.yml | |
working-directory: ./src/main/resources | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Grant execute permission for gradlew | |
run: chmod +x ./gradlew | |
- name: Build with Gradle | |
run: ./gradlew clean build -x test | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name : Build Docker Image & Push to Docker Hub | |
run: | | |
docker build . -t ${{ secrets.DOCKERHUB_USERNAME }}/docker-springboot | |
docker build ./nginx -t ${{ secrets.DOCKERHUB_USERNAME }}/docker-nginx | |
docker push ${{ secrets.DOCKERHUB_USERNAME }}/docker-springboot | |
docker push ${{ secrets.DOCKERHUB_USERNAME }}/docker-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: ${{ secrets.EB_APPLICATION }} | |
environment_name: ${{ secrets.EB_ENVIRONMENT }} | |
version_label: deploy-${{steps.current-time.outputs.formattedTime}} | |
region: ap-northeast-2 | |
deployment_package: docker-compose.yml | |
wait_for_environment_recovery: 180 |