hotfix: edit-ranking-order #114
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: CI-CD | |
| on: | |
| push: | |
| branches: [ 'main' ] | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out Repository | |
| uses: actions/checkout@v2 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v4.3.0 | |
| with: | |
| node-version: 20 | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Echo Env File | |
| run: echo ${{ secrets.ENV_FILE }} | base64 --decode > ./.env | |
| - name: Build Docker image | |
| run: | | |
| docker build -t regreen . | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3.4.0 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Push to Docker Hub | |
| run: | | |
| docker tag regreen ${{ secrets.DOCKERHUB_USERNAME }}/regreen:latest | |
| docker push ${{ secrets.DOCKERHUB_USERNAME }}/regreen:latest | |
| cd: | |
| needs: ci | |
| runs-on: ubuntu-latest | |
| env: | |
| TZ: Asia/Seoul | |
| steps: | |
| - name: Deploy to EC2 via SSH | |
| uses: appleboy/ssh-action@master | |
| with: | |
| host: ${{ secrets.EC2_HOST }} | |
| username: ubuntu | |
| key: ${{ secrets.EC2_SSH_KEY }} | |
| script: | | |
| cd /home/ubuntu/app | |
| ./deploy.sh |