From 0a8a9852b68f218c3c1e4e5b07a9a3f6f2abc555 Mon Sep 17 00:00:00 2001 From: xuhui Date: Wed, 30 Oct 2024 21:15:18 +0800 Subject: [PATCH] add 1000h aliyun deployment --- .github/workflows/deploy-1000h-aliyun.yml | 47 +++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/deploy-1000h-aliyun.yml diff --git a/.github/workflows/deploy-1000h-aliyun.yml b/.github/workflows/deploy-1000h-aliyun.yml new file mode 100644 index 00000000..e59c74ca --- /dev/null +++ b/.github/workflows/deploy-1000h-aliyun.yml @@ -0,0 +1,47 @@ +name: Deploy 1000h website(aliyun) + +on: + workflow_dispatch: + push: + branches: + - main + paths: + - "1000-hours/**" + pull_request: + branches: + - main + paths: + - "1000-hours/**" + +jobs: + deploy: + runs-on: ubuntu-latest + name: Deploy + steps: + # checkout the code + - uses: actions/checkout@v4 + + - uses: actions/cache@v4 + with: + path: "**/node_modules" + key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + + - name: Setup node env + uses: actions/setup-node@master + with: + node-version: "20" + + - name: Install dependencies + run: yarn install + + - name: Build + run: yarn docs:build + + - uses: manyuanrong/setup-ossutil@v2.0 + with: + endpoint: ${{ env.OSS_ENDPOINT }} + access-key-id: ${{ secrets.GLOBAL_OSS_ACCESS_KEY_ID }} + access-key-secret: ${{ secrets.GLOBAL_OSS_ACCESS_KEY_SECRET }} + - run: ossutil cp -r -u -f 1000-hours/.vitepress/dist ${{ secrets.ALIYUN_OSS_PRESS_URL }}1000-hours/ --include "*" --exclude "*.html" -e ${{ env.OSS_ENDPOINT }} + - run: ossutil cp -r -u -f 1000-hours/.vitepress/dist/index.html ${{ secrets.ALIYUN_OSS_PRESS_URL }}1000-hours/ -e ${{ env.OSS_ENDPOINT }} + - run: ossutil set-meta ${{ secrets.ALIYUN_OSS_PRESS_URL }}1000-hours/ Cache-Control:no-cache --include "*.html" -r -f --update -e ${{ env.OSS_ENDPOINT }} \ No newline at end of file