-
Notifications
You must be signed in to change notification settings - Fork 27
63 lines (60 loc) · 2.09 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Deploy
on:
push:
branches:
- master
workflow_dispatch:
inputs:
reason:
description: 'why this workflow is triggered'
required: true
default: 'manually deploy site'
jobs:
deploy_gh_pages:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
environment: "GitHub Action Deploy"
steps:
- name: Install Packages
run: |
pip install pyopenssl ndg-httpsclient pyasn1 coscmd
- uses: actions/checkout@v3
name: Checkout Code
- name: Build Site
run: |
wget -O hugo.tar.gz https://github.com/gohugoio/hugo/releases/download/v0.83.1/hugo_0.83.1_Linux-64bit.tar.gz && tar xzf hugo.tar.gz
./hugo -v
echo 'sjtug.org' > public/CNAME
- name: Deploy to GitHub Pages (sjtug/sjtug.github.io)
if: ${{ github.ref == 'refs/heads/master' }}
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./public
external_repository: sjtug/sjtug.github.io
publish_branch: master
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
force_orphan: true
deploy_tcloud:
name: Deploy to Tencent Cloud
runs-on: ubuntu-latest
environment: "Tencent Cloud API"
steps:
- name: Install Packages
run: |
pip install pyopenssl ndg-httpsclient pyasn1 coscmd
- uses: actions/checkout@v3
name: Checkout Code
- name: Build Site
run: |
wget -O hugo.tar.gz https://github.com/gohugoio/hugo/releases/download/v0.83.1/hugo_0.83.1_Linux-64bit.tar.gz && tar xzf hugo.tar.gz
./hugo -v
- name: Deploy to TCloud
if: ${{ github.ref == 'refs/heads/master' }}
run: |
coscmd config -a "$TCLOUD_API_ID" -s "$TCLOUD_API_KEY" -b sjtug-portal-1251836446 -r ap-chengdu -m 32
cd public && coscmd upload -rs . /
env:
TCLOUD_API_ID: ${{ secrets.TCLOUD_API_ID }}
TCLOUD_API_KEY: ${{ secrets.TCLOUD_API_KEY }}