forked from d2-projects/d2-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
66 additions
and
66 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,75 +11,75 @@ jobs: | |
name: Qiniu CDN | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: '10.x' | ||
- name: Download qshell | ||
run: | | ||
wget http://devtools.qiniu.com/qshell-linux-x86-v2.4.0.zip | ||
unzip qshell-linux-x86-v2.4.0.zip | ||
mv qshell-linux-x86-v2.4.0 qshell | ||
- name: Install packages | ||
run: npm i | ||
- name: Build | ||
run: npm run build:preview | ||
- name: CDN login | ||
run: ./qshell account ${{ secrets.AK }} ${{ secrets.SK }} GITHUB_ACTION | ||
- name: CDN upload | ||
run: | | ||
./qshell qupload2 \ | ||
--src-dir=$GITHUB_WORKSPACE/dist \ | ||
--bucket=d2-cdn \ | ||
--key-prefix=${GITHUB_REPOSITORY//*\//}/preview/ \ | ||
--overwrite=true \ | ||
--check-exists=true \ | ||
--check-hash=true \ | ||
--check-size=true \ | ||
--rescan-local=true \ | ||
--thread-count=32 | ||
# - uses: actions/checkout@v1 | ||
# - uses: actions/setup-node@v1 | ||
# with: | ||
# node-version: '10.x' | ||
# - name: Download qshell | ||
# run: | | ||
# wget http://devtools.qiniu.com/qshell-linux-x86-v2.4.0.zip | ||
# unzip qshell-linux-x86-v2.4.0.zip | ||
# mv qshell-linux-x86-v2.4.0 qshell | ||
# - name: Install packages | ||
# run: npm i | ||
# - name: Build | ||
# run: npm run build:preview | ||
# - name: CDN login | ||
# run: ./qshell account ${{ secrets.AK }} ${{ secrets.SK }} GITHUB_ACTION | ||
# - name: CDN upload | ||
# run: | | ||
# ./qshell qupload2 \ | ||
# --src-dir=$GITHUB_WORKSPACE/dist \ | ||
# --bucket=d2-cdn \ | ||
# --key-prefix=${GITHUB_REPOSITORY//*\//}/preview/ \ | ||
# --overwrite=true \ | ||
# --check-exists=true \ | ||
# --check-hash=true \ | ||
# --check-size=true \ | ||
# --rescan-local=true \ | ||
# --thread-count=32 | ||
- name: CDN refresh | ||
run: | | ||
echo https://cdn.d2.pub/${GITHUB_REPOSITORY//*\//}/preview/ > cdnrefresh.txt | ||
./qshell cdnrefresh --dirs -i ./cdnrefresh.txt | ||
ftp: | ||
name: D2 FTP | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: '10.x' | ||
- name: Build | ||
run: | | ||
npm install | ||
npm run build:preview | ||
- name: Deploy | ||
uses: SamKirkland/[email protected] | ||
env: | ||
FTP_SERVER: ${{ secrets.FTP_SERVER }} | ||
FTP_USERNAME: ${{ secrets.FTP_USERNAME }} | ||
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }} | ||
METHOD: sftp | ||
PORT: ${{ secrets.FTP_PORT }} | ||
LOCAL_DIR: dist | ||
REMOTE_DIR: /www/d2-admin/preview | ||
ARGS: --delete --verbose --parallel=100 | ||
# ftp: | ||
# name: D2 FTP | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v1 | ||
# - uses: actions/setup-node@v1 | ||
# with: | ||
# node-version: '10.x' | ||
# - name: Build | ||
# run: | | ||
# npm install | ||
# npm run build:preview | ||
# - name: Deploy | ||
# uses: SamKirkland/[email protected] | ||
# env: | ||
# FTP_SERVER: ${{ secrets.FTP_SERVER }} | ||
# FTP_USERNAME: ${{ secrets.FTP_USERNAME }} | ||
# FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }} | ||
# METHOD: sftp | ||
# PORT: ${{ secrets.FTP_PORT }} | ||
# LOCAL_DIR: dist | ||
# REMOTE_DIR: /www/d2-admin/preview | ||
# ARGS: --delete --verbose --parallel=100 | ||
|
||
gh-pages: | ||
name: Github Pages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: bahmutov/npm-install@v1 | ||
- name: Build | ||
run: yarn build:github | ||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v2 | ||
env: | ||
PERSONAL_TOKEN: ${{ secrets.ACCESS_TOKEN }} | ||
PUBLISH_BRANCH: gh-pages | ||
PUBLISH_DIR: ./dist | ||
with: | ||
forceOrphan: true | ||
# gh-pages: | ||
# name: Github Pages | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v1 | ||
# - uses: bahmutov/npm-install@v1 | ||
# - name: Build | ||
# run: yarn build:github | ||
# - name: Deploy | ||
# uses: peaceiris/actions-gh-pages@v2 | ||
# env: | ||
# PERSONAL_TOKEN: ${{ secrets.ACCESS_TOKEN }} | ||
# PUBLISH_BRANCH: gh-pages | ||
# PUBLISH_DIR: ./dist | ||
# with: | ||
# forceOrphan: true |