-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (67 loc) · 2.31 KB
/
deploy-example.yml
File metadata and controls
73 lines (67 loc) · 2.31 KB
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
64
65
66
67
68
69
70
71
72
73
name: Deploy Example
on:
push:
branches:
- main
jobs:
main:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install asdf
uses: asdf-vm/actions/setup@v1
- uses: actions/cache@v3
id: asdf-cache
with:
path: |
/home/runner/.asdf
key: ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}
- name: Install asdf tools
run: |
cat .tool-versions | cut -f 1 -d ' ' | xargs -n 1 asdf plugin-add || true
asdf plugin-update --all
asdf install
asdf reshim
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Yarn Dependencies
run: |
yarn
yarn bootstrap
yarn llink
yarn build
- name: Decrypt secrets
env:
ENCRYPTION_KEY: ${{ secrets.ENCRYPTION_KEY }}
run: |
openssl aes-256-cbc -in .github/workflows/secrets/id_rsa.enc -out .github/workflows/secrets/id_rsa -pass pass:$ENCRYPTION_KEY -d -pbkdf2
- name: Setup SSH agent
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
mkdir -p ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
chmod 0600 .github/workflows/secrets/id_rsa
ssh-add .github/workflows/secrets/id_rsa
- name: Deploy Example
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
rm -rf .git
cd examples/create-react-app-typescript/build
git init
git config user.name "Junmin Ahn"
git config user.email 'junminahn@users.noreply.github.com'
git config commit.gpgsign false
git add .
git commit -m "deploy example to github pages"
git push --force --quiet git@github.com:junminahn/react-page-plugins.git master:example