From e3220f0c4c95b8892a814e539f466a0fe90b73cd Mon Sep 17 00:00:00 2001 From: cipchk <cipchk@qq.com> Date: Tue, 2 Jul 2024 21:13:11 +0800 Subject: [PATCH] release: site --- .../build-doc-site-aliyun-docker.yml | 33 +++++++++++++++++++ ...doc-site.yml => build-doc-site-docker.yml} | 4 +-- .github/workflows/deploy-site.yml | 2 +- .github/workflows/mirror-gitee.yml | 2 +- 4 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/build-doc-site-aliyun-docker.yml rename .github/workflows/{docker-build-doc-site.yml => build-doc-site-docker.yml} (90%) diff --git a/.github/workflows/build-doc-site-aliyun-docker.yml b/.github/workflows/build-doc-site-aliyun-docker.yml new file mode 100644 index 0000000000..5efc8c453a --- /dev/null +++ b/.github/workflows/build-doc-site-aliyun-docker.yml @@ -0,0 +1,33 @@ +name: build-doc-site-aliyun-docker + +# on: push +on: + push: + branches: + - master + +jobs: + website: + if: "startsWith(github.event.head_commit.message, 'release')" + runs-on: ubuntu-latest + environment: prod + steps: + - uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login Docker + uses: docker/login-action@v2 + with: + registry: registry.cn-hangzhou.aliyuncs.com + username: ${{ secrets.ALIYUN_USERNAME }} + password: ${{ secrets.ALIYUN_PASSWORD }} + + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + file: ./Dockerfile.docs + push: true + tags: registry.cn-hangzhou.aliyuncs.com/alain/docs:latest diff --git a/.github/workflows/docker-build-doc-site.yml b/.github/workflows/build-doc-site-docker.yml similarity index 90% rename from .github/workflows/docker-build-doc-site.yml rename to .github/workflows/build-doc-site-docker.yml index 2a01ead378..ce9daab661 100644 --- a/.github/workflows/docker-build-doc-site.yml +++ b/.github/workflows/build-doc-site-docker.yml @@ -1,4 +1,4 @@ -name: docker-build-doc-site +name: build-doc-site-docker # on: push on: @@ -8,7 +8,7 @@ on: jobs: website: - if: "startsWith(github.event.commits[0].message, 'release')" + if: "startsWith(github.event.head_commit.message, 'release')" runs-on: ubuntu-latest environment: prod steps: diff --git a/.github/workflows/deploy-site.yml b/.github/workflows/deploy-site.yml index d1f69f4fdb..e6c3d8ffc5 100644 --- a/.github/workflows/deploy-site.yml +++ b/.github/workflows/deploy-site.yml @@ -4,7 +4,7 @@ on: push jobs: website: - if: "startsWith(github.event.commits[0].message, 'release')" + if: "startsWith(github.event.head_commit.message, 'release')" runs-on: ubuntu-latest environment: prod steps: diff --git a/.github/workflows/mirror-gitee.yml b/.github/workflows/mirror-gitee.yml index fa5c187830..231f0ee97f 100644 --- a/.github/workflows/mirror-gitee.yml +++ b/.github/workflows/mirror-gitee.yml @@ -4,7 +4,7 @@ on: push jobs: to_gitee: - if: "!startsWith(github.event.commits[0].message, 'release')" + if: "!startsWith(github.event.head_commit.message, 'release')" runs-on: ubuntu-latest steps: - uses: actions/checkout@v4