diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 14d75cf4..c64b3388 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -32,9 +32,44 @@ jobs: ${{ runner.os }}-build- ${{ runner.os }}- - run: npm install + - run: echo "🍏 This job's status is ${{ job.status }}." + - run: npm run build + - name: publish + id: publish + uses: JS-DevTools/npm-publish@v3 + with: + token: ${{ secrets.TDESIGN_NPM_TOKEN }} + tag: ${{ contains(github.ref_name, 'beta') && 'beta' || 'latest' }} + - if: steps.publish.outputs.type != 'none' + run: | + echo "Version changed: ${{ steps.publish.outputs.old-version }} => ${{ steps.publish.outputs.version }}" + + DEPLOY_HISTORY_VERSION_SITE: + runs-on: ubuntu-latest + if: github.event.ref_type == 'tag' + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - uses: actions/setup-node@v4 + with: + node-version: 18 + - uses: actions/cache@v4 + env: + cache-name: cache-nodemodules + with: + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + - run: npm install - name: Build site run: npm run site:preview + - name: upload surge service id: deploy run: | @@ -45,17 +80,7 @@ jobs: export DEPLOY_DOMAIN=https://$tag_name-$project_name.surge.sh npx surge --project _site --domain $DEPLOY_DOMAIN --token ${{ secrets.TDESIGN_SURGE_TOKEN }} echo $DEPLOY_DOMAIN - - run: echo "🍏 This job's status is ${{ job.status }}." - - run: npm run build - - name: publish - id: publish - uses: JS-DevTools/npm-publish@v3 - with: - token: ${{ secrets.TDESIGN_NPM_TOKEN }} - tag: ${{ contains(github.ref_name, 'beta') && 'beta' || 'latest' }} - - if: steps.publish.outputs.type != 'none' - run: | - echo "Version changed: ${{ steps.publish.outputs.old-version }} => ${{ steps.publish.outputs.version }}" + UPDATE_OFFICIAL_WEBSITE: runs-on: ubuntu-latest if: github.event.ref_type == 'tag' @@ -74,4 +99,3 @@ jobs: git fetch origin git merge origin/develop git push origin main - \ No newline at end of file