[deploy] ls 를 통해 해당 패키지 만들어졌는지 확인 (#120) #6
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: | |
- release/** | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Jdk 21 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '21' | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Debug Secrets | |
run: | | |
echo "Secrets YML value:" | |
echo "${{ secrets.PROD_CONFIG }}" | |
- name: Push yml file | |
run: | | |
mkdir -p ./src/main/resources | |
ls ./src/main/resources | |
cd ./src/main/resources/ | |
echo ${{ secrets.PROD_CONFIG }} > application-prod.yml | |
echo "hello is yml file push success?" | |
cat ./src/main/resources/application-prod.yml | |
- name: Build with Gradle | |
run: ./gradlew -x test clean build | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Build and Push Docker Image | |
run: | | |
docker build -t ${{ secrets.DOCKER_USERNAME }}/ggang:latest . | |
docker push ${{ secrets.DOCKER_USERNAME }}/ggang:latest | |
- name: deploy appleboy | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.SSH_KEY }} | |
port: ${{ secrets.PORT }} | |
script: | | |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKERHUB_PASSWORD }} | |
docker pull ${{ secrets.DOCKER_USERNAME }}/ggang:latest | |
./deploy.sh | |
echo "now finished deploy: $(date '+%Y-%m-%d %H:%M:%S')" > deploy_success_date.txt |