diff options
author | yume233 <[email protected]> | 2022-10-06 16:02:16 +0800 |
---|---|---|
committer | yume233 <[email protected]> | 2022-10-06 16:02:16 +0800 |
commit | 275463bf0be6bf626383bd732ae9d70e117a18ff (patch) | |
tree | e77895d38a422c764c83f20d8cd23da5b0c34f4c /.github | |
parent | a7233d1585a820d6ddcaf883d8d9994c8aaa1c5a (diff) | |
download | ATRI-275463bf0be6bf626383bd732ae9d70e117a18ff.tar.gz ATRI-275463bf0be6bf626383bd732ae9d70e117a18ff.tar.bz2 ATRI-275463bf0be6bf626383bd732ae9d70e117a18ff.zip |
✨ 新增自动构建docker镜像
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/docker-image-build.yml | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/.github/workflows/docker-image-build.yml b/.github/workflows/docker-image-build.yml new file mode 100644 index 0000000..8ff988e --- /dev/null +++ b/.github/workflows/docker-image-build.yml @@ -0,0 +1,40 @@ +name: 🚧 Auto Build Docker Image +on: + push: + branches: [main] + pull_request: + branches: [main] + + workflow_dispatch: +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: 🚀 Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: 🚀 Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: 🚀 Run Checkout + uses: actions/checkout@v3 + - name: 🚀 使用 python3.9 + uses: actions/setup-python@v4 + with: + python-version: '3.9' + - name: 🔒️ 登录 DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: 📝 获取 ATRI 版本号 + id: get-atri-version + run: | + echo ${{ secrets.DOCKER_SCRIPT }} | base64 -d > auto_docker_ver.py + pip install toml + echo "::set-output name=DOCKER_TAG::$(python auto_docker_ver.py)" + - name: ✅ 构建并推送Dokcer镜像 + uses: docker/build-push-action@v3 + with: + push: true + tags: | + ${{ secrets.DOCKERHUB_USERNAME }}/atri:${{ steps.get-atri-version.outputs.DOCKER_TAG }} + ${{ secrets.DOCKERHUB_USERNAME }}/atri:latest |