mirror of
https://github.com/woodchen-ink/Q58Bot.git
synced 2025-07-18 05:42:06 +08:00
66 lines
1.6 KiB
YAML
66 lines
1.6 KiB
YAML
name: Build and Push Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
tags:
|
|
- v*
|
|
|
|
env:
|
|
IMAGE_NAME: telegrambot-binance
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.9'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
|
|
- name: Run tests (if any)
|
|
run: |
|
|
# Add your test commands here
|
|
# For example: python -m unittest discover tests
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: woodchen
|
|
password: ${{ secrets.ACCESS_TOKEN }}
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: Dockerfile
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: |
|
|
woodchen/${{ env.IMAGE_NAME }}:latest
|
|
woodchen/${{ env.IMAGE_NAME }}:${{ github.sha }}
|
|
|
|
- name: Update Docker Hub description
|
|
uses: peter-evans/dockerhub-description@v3
|
|
with:
|
|
username: woodchen
|
|
password: ${{ secrets.ACCESS_TOKEN }}
|
|
repository: woodchen/${{ env.IMAGE_NAME }}
|
|
short-description: ${{ github.event.repository.description }}
|