Merge pull request #1876 from zexi/typoe-fullstack #779
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: Release github pages | |
on: | |
push: | |
branches: | |
- release/3.10 # Set a branch to deploy | |
# - release/* # Set a branch to deploy | |
# - master # Set a branch to deploy | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive # Fetch the Docsy theme | |
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: '0.120.0' | |
extended: true | |
- name: Setup Node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- name: Cache dependencies | |
uses: actions/cache@v1 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- run: npm install | |
- name: Setup python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.11.3' | |
- name: Install python requirements | |
run: | | |
pip3 install pyyaml | |
- name: Build public site | |
run: | | |
./scripts/build.py --host=https://www.cloudpods.org --edition=ce --multi-versions --no-out-fetch | |
ls -alh ./public | |
# - name: Publish site | |
# uses: peaceiris/actions-gh-pages@v3 | |
# with: | |
# personal_token: ${{ secrets.PERSONAL_TOKEN }} | |
# publish_dir: ./public | |
# external_repository: yunionio/yunionio.github.io | |
# allow_empty_commit: true | |
# cname: www.cloudpods.org | |
# publish_branch: master | |
# | |
- name: Publish site to AWS s3 | |
uses: jakejarvis/s3-sync-action@master | |
with: | |
args: --acl public-read --follow-symlinks --delete | |
env: | |
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
# deploy config | |
AWS_REGION: 'ap-east-1' | |
SOURCE_DIR: 'public' | |
- name: Publish site to Aliyun OSS use aliyuncli | |
env: | |
ALIYUN_CLOUD_ENV: "InternationalCloud" | |
ALIYUN_ACCESS_KEY: ${{ secrets.ALIYUN_ACCESS_KEY_ID }} | |
ALIYUN_SECRET: ${{ secrets.ALIYUN_ACCESS_KEY_SECRET }} | |
# ALIYUN_REGION: ${{ secrets.ALIYUN_REGION }} | |
ALIYUN_REGION: "cn-beijing" | |
BUCKET: ${{ secrets.ALIYUN_OSS_BUCKET }} | |
shell: bash | |
run: | | |
set -o xtrace | |
wget https://github.com/zexi/cloudmux/releases/download/v3.11-20231207.0/aliyuncli-amd64 && chmod a+x aliyuncli-amd64 | |
./aliyuncli-amd64 oss-upload --acl public-read $BUCKET '' public | |
# - name: Publish site to Aliyun OSS | |
# uses: Menci/upload-to-oss@beta-v1 | |
# # https://github.com/marketplace/actions/upload-files-to-aliyun-oss-incremental | |
# with: | |
# # Use Access Key | |
# access-key-id: ${{ secrets.ALIYUN_ACCESS_KEY_ID }} | |
# access-key-secret: ${{ secrets.ALIYUN_ACCESS_KEY_SECRET }} | |
# bucket: ${{ secrets.ALIYUN_OSS_BUCKET }} | |
# endpoint: ${{ secrets.ALIYUN_OSS_ENDPOINT }} | |
# local-path: public | |
# remote-path: '' | |
# # Retry 5 times on failure of each OSS operation | |
# retry: 5 | |
# # Use increment or not | |
# increment: true |