forked from typora/theme.typora.io
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (44 loc) · 1.39 KB
/
deploy_aliyun.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
---
name: 'deploy'
# yamllint disable-line rule:truthy
on:
push:
branches:
- gh-pages
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Cloning repo
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.ALIYUN_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
name: id_rsa
if_key_exists: replace
# known_hosts: unnecessary
- name: SETUP
run: |
# SETUP SSH
touch /home/runner/.ssh/github.pem
echo "$PEM_KEY" > /home/runner/.ssh/github.pem
chmod 400 /home/runner/.ssh/github.pem
cp /home/runner/.ssh/github.pem /home/runner/.ssh/id_rsa_ec2
ssh-keygen -y -f /home/runner/.ssh/github.pem > /home/runner/.ssh/id_rsa_ec2.pub
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa_ec2
# SETUP GIT
git config --global user.email "[email protected]"
git config --global user.name "Typora"
git remote add a [email protected]:theme
sed -i 's/rubygems.org/gems.ruby-china.com/g' Gemfile
git commit -am "update Gemfile"
git checkout -b master
env:
PEM_KEY: ${{secrets.ALIYUN_PEM}}
- name: PUSH
run: git push -f -u a master