fix: change specific file to asterisk #2
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: Backend Deploy | |
on: | |
push: | |
branches: | |
- dev | |
paths: | |
- backend/** | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: prod | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
distribution: temurin | |
cache: gradle | |
- name: Cache Gradle | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/build.gradle') }} | |
restore-keys: ${{ runner.os }}-gradle- | |
- name: Add execute permissions | |
working-directory: backend | |
run: chmod +x gradlew | |
- name: Build | |
working-directory: backend | |
run: ./gradlew build -x test | |
- name: Setup environment variables | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.KEY }} | |
script: | | |
cd ~/${{ github.event.repository.name }} | |
echo "JASYPT_PASSWORD=${{ secrets.JASYPT_PASSWORD }}" > .env | |
echo "MYSQL_ROOT_PASSWORD=${{ secrets.MYSQL_ROOT_PASSWORD }}" >> .env | |
- name: Copy docker compose | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.KEY }} | |
source: docker-compose.yaml | |
target: ~/${{ github.event.repository.name }} | |
- name: Copy bootJar | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.KEY }} | |
source: backend/build/libs/${{ github.event.repository.name }}.jar | |
target: ~/${{ github.event.repository.name }} | |
- name: Restart docker compose | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.KEY }} | |
script: | | |
cd ~/${{ github.event.repository.name }} | |
docker compose restart be |