Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 36 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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'
Expand All @@ -74,4 +99,3 @@ jobs:
git fetch origin
git merge origin/develop
git push origin main

Loading