Merge pull request #49 from Team9994/dev #51
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: Deploy Frontend | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: env setting | |
| run: | | |
| echo "${{secrets.ENV}}" > .env | |
| - name: docker login | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ secrets.DOCKER_ID }} | |
| password: ${{ secrets.DOCKER_PWD }} | |
| - name: docker image build | |
| run: | | |
| docker build -t ${{ secrets.DOCKER_ID }}/${{ secrets.DOCKER_REPOSITORY }}:${{ secrets.DOCKER_TAG }} . | |
| - name: docker hub push | |
| run: | | |
| docker push ${{ secrets.DOCKER_ID }}/${{ secrets.DOCKER_REPOSITORY }}:${{ secrets.DOCKER_TAG }} | |
| - name: SSH into server and deploy | |
| uses: appleboy/[email protected] | |
| with: | |
| host: ${{ secrets.SSH_HOST }} | |
| username: ${{ secrets.SSH_USERNAME }} | |
| password: ${{ secrets.SSH_PASSWORD }} | |
| port: 22 | |
| script: | | |
| cd /docker | |
| ./deploy-front.sh |