Repository navigation
update docker img name #14
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 bit-bot | |
| # On pull request, make a deployment to Preview | |
| # On merge into main, make a deployment to Develop | |
| # On merge into prod, flag prod, make a deployment to Production | |
| on: | |
| push: | |
| branches: [main, production] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set pipeline | |
| id: pipeline | |
| # if its a PR, then its for preview, else its for development or prod based on what it's being pushed to. | |
| run: echo ::set-output name=pipeline::${{ github.event_name == 'pull_request' && 'Preview' || (github.ref == 'refs/heads/production' && 'Production' || 'Development') }} | |
| - uses: chrnorm/deployment-action@releases/v1 | |
| name: Create GitHub deployment | |
| id: deployment | |
| with: | |
| token: "${{ github.token }}" | |
| environment: ${{ steps.pipeline.outputs.pipeline }} | |
| target_url: "" | |
| - | |
| name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ vars.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - | |
| name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - | |
| name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| push: true | |
| tags: bitsofgood/bit-bot:latest | |
| - name: Update deployment status (success) | |
| if: success() | |
| uses: chrnorm/deployment-status@releases/v1 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| target_url: ${{ steps.vercel_deploy.outputs.preview-url }} | |
| environment_url: ${{ steps.vercel_deploy.outputs.preview-url }} | |
| state: "success" | |
| deployment_id: ${{ steps.deployment.outputs.deployment_id }} | |
| - name: Update deployment status (failure) | |
| if: failure() | |
| uses: chrnorm/deployment-status@releases/v1 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| target_url: ${{ steps.vercel_deploy.outputs.preview-url }} | |
| environment_url: ${{ steps.vercel_deploy.outputs.preview-url }} | |
| state: "failure" | |
| deployment_id: ${{ steps.deployment.outputs.deployment_id }} |