refactor #54
Workflow file for this run
This file contains hidden or 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: build-and-deploy | |
| #on: | |
| # push: | |
| # branches: [ release ] | |
| # | |
| #jobs: | |
| # deploy: | |
| # runs-on: ubuntu-latest | |
| # | |
| # # Job-level 환경 변수 | |
| # env: | |
| # IMAGE: ${{ vars.DOCKERHUB_USERNAME }}/weady:latest # jangwoopark/weady:latest | |
| # | |
| # steps: | |
| # # 소스 체크아웃 | |
| # - uses: actions/checkout@v4 | |
| # with: | |
| # submodules: 'recursive' | |
| # token: ${{ secrets.GH_SUBMODULE_TOKEN }} | |
| # | |
| # # Docker Hub 로그인 | |
| # - name: Login to Docker Hub | |
| # uses: docker/login-action@v3 | |
| # with: | |
| # username: ${{ vars.DOCKERHUB_USERNAME }} | |
| # password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| # | |
| # # 이미지 빌드 & 푸시 | |
| # - uses: docker/setup-buildx-action@v3 | |
| # - uses: docker/build-push-action@v6 | |
| # with: | |
| # context: . | |
| # push: true | |
| # tags: ${{ env.IMAGE }} | |
| # | |
| # # EC2 배포 | |
| # - name: Deploy to EC2 via SSH | |
| # uses: appleboy/ssh-action@v1.0.0 | |
| # with: | |
| # host: ${{ secrets.EC2_HOST }} | |
| # username: ${{ secrets.EC2_USER }} | |
| # key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| # script: | | |
| # # Docker/Compose 설치 (멱등) | |
| # if ! command -v docker >/dev/null 2>&1; then | |
| # sudo yum -y install docker | |
| # sudo systemctl enable --now docker | |
| # sudo usermod -aG docker ec2-user | |
| # fi | |
| # if ! docker compose version >/dev/null 2>&1; then | |
| # sudo mkdir -p /usr/local/lib/docker/cli-plugins | |
| # sudo curl -SL "https://github.com/docker/compose/releases/latest/download/docker-compose-linux-$(uname -m)" \ | |
| # -o /usr/local/lib/docker/cli-plugins/docker-compose | |
| # sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose | |
| # fi | |
| # | |
| # # Private 레포 pull 전 로그인 | |
| # echo "${{ secrets.DOCKERHUB_TOKEN }}" | \ | |
| # docker login -u "${{ vars.DOCKERHUB_USERNAME }}" --password-stdin | |
| # | |
| # docker pull ${{ env.IMAGE }} | |
| # docker compose -f ~/docker-compose.yml up -d --pull always --remove-orphans | |
| # docker image prune -af |