seata website deploy on oss #1470
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: seata website deploy on oss | |
on: | |
push: | |
branches: | |
- docusaurus | |
#This schedule only takes effect in the default branch | |
schedule: | |
- cron: '0 */12 * * *' | |
jobs: | |
Build-Deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js 19.5.x | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 19.5.x | |
- name: Build | |
run: | | |
npm install && npm run build | |
mkdir deploy-dist && cp -R build/* deploy-dist/ | |
mv .htaccess .asf.yaml *.txt *.html deploy-dist/ | |
- name: generate sitemap.xml and site.txt | |
# The new generated sitemap for the index form, | |
# in order to ensure consistency with the old version, | |
# here directly to the details of the sitemap (sitemap.0.xml) renamed as a whole sitemap, | |
# if the number of articles increases in the future, | |
# the details of the sitemap will be split into multiple files (sitemap.0.xml,sitemap.1.xml), | |
# you may need to modify. | |
env: | |
ALGOLIA_APIKEY: ${{secrets.ALGOLIA_APIKEY}} | |
run: | | |
mkdir sitemaps && node sitemap.js | |
cp sitemaps/sitemap.0.xml deploy-dist/sitemap.xml | |
cp sitemaps/site.txt deploy-dist/site.txt | |
- name: baidu link submit | |
env: | |
BAIDU_LINK_SUBMIT_TOKEN: ${{secrets.BAIDU_LINK_SUBMIT_TOKEN}} | |
run: node baiduLinkSubmit.js | |
- name: Install serverless-devs | |
run: npm i @serverless-devs/s@2.2.2 -g --registry=https://registry.npmmirror.com | |
- name: Config serverless-devs | |
run: s config add --AccountID ${{secrets.ACCOUNT_ID}} --AccessKeyID ${{secrets.ACCESS_KEYID}} --AccessKeySecret ${{secrets.ACCESS_KEYSECRET}} -a seata -f | |
- name: Deploy on OSS | |
run: s deploy --use-local -y |