This repository has been archived by the owner on Jul 29, 2024. It is now read-only.
Run Docker Compose #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: Run Docker Compose | |
on: | |
workflow_call: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
deploy: | |
runs-on: [self-hosted,dev] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: create .env | |
run: | | |
touch .env | |
echo "DOCKER_USERNAME=${{ secrets.DOCKER_USERNAME }}" >> .env | |
echo "DB_URL=${{ secrets.DEV_DB_URL }}" >> .env | |
echo "DB_USERNAME=${{ secrets.DB_USERNAME }}" >> .env | |
echo "DB_PASSWORD=${{ secrets.DB_PASSWORD }}" >> .env | |
echo "SPRING_PROFILES_ACTIVE=${{ secrets.SPRING_PROFILES_ACTIVE }}" >> .env | |
echo "PROFILE=${{ secrets.DEV_PROFILE }}" >> .env | |
echo "KAKAO_CLIENT_ID=${{ secrets.KAKAO_CLIENT_ID }}" >> .env | |
echo "KAKAO_CLIENT_SECRET=${{ secrets.KAKAO_CLIENT_SECRET }}" >> .env | |
echo "TISTORY_CLIENT_ID=${{ secrets.TISTORY_CLIENT_ID }}" >> .env | |
echo "TISTORY_CLIENT_SECRET=${{ secrets.TISTORY_CLIENT_SECRET }}" >> .env | |
echo "NOTION_CLIENT_ID=${{ secrets.NOTION_CLIENT_ID }}" >> .env | |
echo "NOTION_CLIENT_SECRET=${{ secrets.NOTION_CLIENT_SECRET }}" >> .env | |
echo "JWT_SECRET_KET=${{ secrets.JWT_SECRET_KEY }}" >> .env | |
echo "ACCESS_TOKEN_EXPIRE=${{ secrets.ACCESS_TOKEN_EXPIRE_LENGTH }}" >> .env | |
echo "REFRESH_TOKEN_EXPIRE_LENGTH=${{ secrets.REFRESH_TOKEN_EXPIRE_LENGTH }}" >> .env | |
## deploy to production | |
- name: Deploy to prod | |
run: | | |
sudo docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | |
sudo docker compose down | |
sudo docker compose pull | |
sudo docker compose up -d |