Merge pull request #17 from techbloghub/feat/posting-search #68
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 | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
| - name: Docker Build and Push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| file: ./Dockerfile | |
| platforms: linux/amd64 | |
| tags: | | |
| ${{ secrets.DOCKER_HUB_USERNAME }}/server:${{ github.run_number }} | |
| ${{ secrets.DOCKER_HUB_USERNAME }}/server:latest | |
| deploy: | |
| needs: build | |
| runs-on: self-hosted | |
| steps: | |
| - name: deploy | |
| run: cd /home/ubuntu && ./deploy.sh | |
| - name: Send Failure Message | |
| if: ${{ failure() }} | |
| uses: Ilshidur/[email protected] | |
| env: | |
| DISCORD_WEBHOOK: ${{ secrets.DEPLOY_WEBHOOK_URL }} | |
| DISCORD_USERNAME: 배포봇 | |
| with: | |
| args: 'The deployment of techbloghub/{{ EVENT_PAYLOAD.repository.full_name }} has failed' |