fix : fix webconfig #90
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: Dev Deploy to AWS | |
on: | |
push: | |
branches: [ "develop" ] | |
jobs: | |
build-deploy: | |
runs-on: ubuntu-latest | |
environment: DEV | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- 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: Grant Permissions for Gradle build | |
run: chmod +x gradlew | |
- name: Gradle building | |
run: ./gradlew build -x test | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Extract Docker metadata | |
id: metadata | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{ secrets.DOCKER_USERNAME }}/shoot | |
tags: | | |
type=sha,prefix= | |
type=ref,event=branch | |
- name: Build and push Docker image | |
run: | | |
docker build . -t ${{ secrets.DOCKER_USERNAME }}/shoot:latest | |
docker push ${{ secrets.DOCKER_USERNAME }}/shoot:latest | |
- name: Deploy on EC2 | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.AWS_EC2_IP }} | |
username: ${{ secrets.AWS_EC2_USER }} | |
key: ${{ secrets.AWS_EC2_SSH_KEY }} | |
port: 22 | |
script: | | |
cd /home/ubuntu | |
docker pull ${{ secrets.DOCKER_USERNAME }}/shoot:latest | |
docker-compose down | |
docker-compose up -d |