From 490b20bcdf32e86191cb226eddae42cd5dd54f8d Mon Sep 17 00:00:00 2001 From: Binwei Fang Date: Sun, 19 Feb 2023 06:53:49 +0800 Subject: [PATCH] test: update ci (#15) - update dockerhub ci - add ci for pr --- .github/workflows/dockerhub.yml | 39 +++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 30 ++----------------------- 2 files changed, 41 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/dockerhub.yml diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml new file mode 100644 index 0000000..61a9819 --- /dev/null +++ b/.github/workflows/dockerhub.yml @@ -0,0 +1,39 @@ +name: docker build&upload + +on: +# 支持手动触发 + workflow_dispatch: + inputs: + tag: + default: "latest" + description: dockerhub tag + push: + branches: + - 'master' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v2 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: fangbinwei/aliyun-oss-website-action:${{ github.event.inputs.tag}} \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9ccad6b..9a1628b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,6 +3,7 @@ name: deploy test on: # 支持手动触发 workflow_dispatch: + pull_request: push: branches: - 'master' @@ -60,31 +61,4 @@ jobs: CNAME demo1/ demo2/*.md - demo2/*/*.md - - - docker: - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v2 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v2 - with: - context: . - push: true - tags: fangbinwei/aliyun-oss-website-action:latest \ No newline at end of file + demo2/*/*.md \ No newline at end of file