Added warnings to the start of the image command. #27
This file contains 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: Docker Image CI | |
# !!! IMPORTANT !!! Do not run this on self hosted. Commands will cause havioc. | |
# Needs to be on GitHub hosted runners, if you want to run on self hosted, remove the tailscale commands | |
# and the push to prod command since it relies on tailscale and a webhook to push to prod. | |
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
concurrency: | |
group: "build" | |
cancel-in-progress: false | |
on: | |
push: | |
branches: [ "main" ] | |
jobs: | |
Build-and-Push: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and push image for the bot | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: Dockerfile | |
push: true | |
tags: ${{ secrets.DOCKERHUB_USERNAME }}/cblbot:latest | |
- name: Login to Tailscale | |
continue-on-error: true | |
run: ${{ secrets.TAILSCALE_SCRIPT }} | |
- name: Push to prod | |
continue-on-error: true | |
run: curl -X POST ${{ secrets.PUSH_WEBHOOK }} | |
- name: Logout of Tailscale | |
continue-on-error: true | |
run: sudo tailscale logout |