mirror of
https://github.com/Xtao-Labs/QQ-GitHub-Bot.git
synced 2025-01-30 15:08:54 +00:00
👷 update ci
This commit is contained in:
parent
bd4efc1533
commit
a27e7d1702
63
.github/workflows/docker_release.yml
vendored
Normal file
63
.github/workflows/docker_release.yml
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup poetry
|
||||
uses: Gr1N/setup-poetry@v4
|
||||
|
||||
- name: Setup Docker
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||
|
||||
- name: Login to Github Container Registry
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Get Version
|
||||
id: version
|
||||
run: |
|
||||
echo "::set-output name=VERSION::$(poetry version -s)"
|
||||
echo "::set-output name=TAG::${GITHUB_REF#refs/tags/v}"
|
||||
|
||||
- name: Check Version
|
||||
if: ${{ steps.version.outputs.VERSION != steps.version.outputs.TAG }}
|
||||
run: exit 1
|
||||
|
||||
|
||||
- name: Generate Tags
|
||||
uses: docker/metadata-action@v3
|
||||
id: metadata
|
||||
with:
|
||||
images: |
|
||||
cscs181/qq-github-bot
|
||||
ghcr.io/cscs181/qq-github-bot
|
||||
tags: |
|
||||
type=semver,pattern={{version}}
|
||||
type=sha
|
||||
|
||||
- name: Build and Publish
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.metadata.outputs.tags }}
|
||||
labels: ${{ steps.metadata.outputs.labels }}
|
@ -14,7 +14,7 @@ services:
|
||||
container_name: bot
|
||||
# volumes:
|
||||
# - "/etc/localtime:/etc/localtime"
|
||||
# - "./:/app/"
|
||||
# - "./.env:/app/.env.prod" # replace "./.env" with your own config file
|
||||
ports:
|
||||
- "$PORT:$PORT"
|
||||
environment:
|
||||
|
Loading…
Reference in New Issue
Block a user