Skip to content

Commit

Permalink
CF_DOMAIN可配DIRECT直连 (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaokaixuan authored Dec 2, 2021
1 parent 0163f45 commit 6ad277c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,23 @@ jobs:

- name: Install and Build 🔧
env:
CF_DOMAIN: ${{ secrets.CF_DOMAIN }} # CF-Workers反代域名
CF_DOMAIN: ${{ secrets.CF_DOMAIN }} # CF-Workers反代域名,`DIRECT`直连
REPO_NAME: ${{ github.event.repository.name }}
BASE_PATH: ${{ secrets.BASE_PATH }} # 页面Base-path,默认"/{repo_name}"如"/pikpak"
INVITE_CODE: ${{ secrets.INVITE_CODE }} # APK邀请码
CF_INVITE: ${{ secrets.CF_INVITE }} # CF-Workers邀请域名
CNAME_DOMAIN: ${{ secrets.CNAME_DOMAIN }} # CNAME域名
run: |
[ $CF_DOMAIN ] && sed -i "s/cors.z7.workers.dev/$CF_DOMAIN/g" src/utils/axios.ts
[ $CF_DOMAIN ] && {
[ "$CF_DOMAIN" == "DIRECT" ] && sed -i "/\[/,/]/cexport const proxy = []" src/config/index.ts || \
sed -i "/\[/,/]/cexport const proxy = ['https://$CF_DOMAIN']" src/config/index.ts;
}
[ $BASE_PATH ] || BASE_PATH="/${REPO_NAME}"
[ "$BASE_PATH" != "/pikpak" ] && sed -i "s|/pikpak|$BASE_PATH|g" vite.config.ts
[ $INVITE_CODE ] && sed -i "s|apk/url/225815|apk/url/$INVITE_CODE|g" src/views/login.vue
[ $CF_INVITE ] && sed -i "s/invite.z7.workers.dev/$CF_INVITE/g" src/views/register.vue src/views/sms.vue src/views/testtest.vue
[ $CNAME_DOMAIN ] && echo "$CNAME_DOMAIN" > public/CNAME
npm install
npm run build
Expand Down

0 comments on commit 6ad277c

Please sign in to comment.