Skip to content

Update docker-image.yml #77

Update docker-image.yml

Update docker-image.yml #77

Workflow file for this run

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/bot_dbs:latest
platforms: linux/amd64,linux/arm64
deploy:
needs: build
runs-on: self-hosted
steps:
- name: Deploy
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_TOKEN }}
docker pull ${{ secrets.DOCKER_USERNAME }}/dbs_bot:latest
docker stop dbs_bot || true
docker rm dbs_bot || true
docker run -e TOKEN=${{ secrets.TOKEN }} \
-e DB_NAME=${{ secrets.DB_NAME }} \
-e DB_USER=${{ secrets.DB_USER }} \
-e DB_PASSWORD=${{ secrets.DB_PASSWORD }} \
-e DB_HOST=${{ secrets.DB_HOST }} \
-e MAIL=${{ secrets.MAIL }} \
-e ID_DISCORD_CHANNEL_MAIL=${{ secrets.ID_DISCORD_CHANNEL_MAIL }} \
-d --restart always --name dbs_bot \
${{ secrets.DOCKER_USERNAME }}/dbs_bot:latest