-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (35 loc) · 1 KB
/
Copy pathBuildDocker.yaml
File metadata and controls
43 lines (35 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: BuildDockerImage
on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]
workflow_dispatch:
jobs:
BuildDockerImage:
runs-on: ubuntu-latest
# 添加条件判断
continue-on-error: ${{ startsWith(github.ref, 'refs/heads/dev') }}
steps:
- uses: actions/checkout@v3
- name: Set tag with date
run: echo "TAG=qqbot:$(date +'%y%m%d%H%M')" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# - name: Log in to Docker Hub
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKER_HUB_USERNAME }}
# password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build and export Docker Image
uses: docker/build-push-action@v3
with:
context: .
push: false
tags: ${{ env.TAG }}
outputs: type=docker,dest=qqbot.tar
- name: Upload Docker Image to Release
uses: actions/upload-artifact@v4
with:
name: qqbot-image
path: qqbot.tar