8
8
jobs :
9
9
homebrew :
10
10
runs-on : ubuntu-latest
11
+ env :
12
+ NODE_AUTH_TOKEN : ${{secrets.NPM_TOKEN}}
13
+ AWS_SDK_LOAD_CONFIG : true
14
+ AWS_PROFILE : cloudgraph-iac
15
+ NODE_ENV : " cicd"
11
16
steps :
12
17
- uses : actions/checkout@v3
13
18
with :
14
19
fetch-depth : 0
15
20
persist-credentials : false
16
- token : ${{secrets.gh_token }}
21
+ token : ${{secrets.GH_TOKEN }}
17
22
- uses : actions/setup-node@v2
18
23
with :
19
24
node-version : 16
20
- registry-url : ' https://registry.npmjs.org'
25
+ registry-url : " https://registry.npmjs.org"
21
26
22
27
- name : Mkdir .aws
23
28
run : mkdir -p ~/.aws
@@ -30,21 +35,22 @@ jobs:
30
35
output=json
31
36
32
37
[profile cloudgraph-iac]
33
- role_arn = $AWS_ROLE_ARN
38
+ role_arn = ${{ secrets. AWS_ROLE_ARN }}
34
39
source_profile = default
35
40
EOF
36
41
- name : Set .aws/credentials
37
42
run : |
38
43
cat << EOF > ~/.aws/credentials
39
44
[default]
40
- aws_access_key_id = $AWS_ACCESS_KEY_ID
41
- aws_secret_access_key = $ AWS_SECRET_ACCESS_KEY
45
+ aws_access_key_id = ${{ secrets. AWS_ACCESS_KEY_ID }}
46
+ aws_secret_access_key = ${{ secrets. AWS_SECRET_ACCESS_KEY }}
42
47
EOF
48
+
43
49
- name : Get cache directory
44
50
id : npm-cache-dir
45
51
run : |
46
52
echo "::set-output name=dir::$(npm config get cache)"
47
-
53
+
48
54
- name : Restoring cache
49
55
id : npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
50
56
uses : actions/cache@v2
@@ -61,14 +67,21 @@ jobs:
61
67
- name : Build
62
68
run : yarn build
63
69
64
- - name : Homebrew
65
- run : yarn homebrew
70
+ - name : Add SSH key
71
+ env :
72
+ SSH_AUTH_SOCK : /tmp/ssh_agent.sock
73
+ run : |
74
+ mkdir -p ~/.ssh
75
+ ssh-keyscan github.com >> ~/.ssh/known_hosts
76
+ echo "${{ secrets.AUTODEPLOY_SSH_KEY }}" > ~/.ssh/github_actions
77
+ chmod 600 ~/.ssh/github_actions
78
+ ssh-agent -a $SSH_AUTH_SOCK > /dev/null
79
+ ssh-add ~/.ssh/github_actions
80
+
81
+ - name : Homebrew
66
82
env :
67
- NODE_AUTH_TOKEN : ${{secrets.npm_token}}
68
- AWS_SDK_LOAD_CONFIG : true
69
- AWS_PROFILE : cloudgraph-iac
70
- AWS_ACCESS_KEY_ID : ${{secrets.aws_access_key_id}}
71
- AWS_SECRET_ACCESS_KEY : ${{secrets.aws_secret_access_key}}
72
- AWS_ROLE_ARN : ${{secrets.aws_role_arn}}
73
- NODE_ENV : ' cicd'
74
-
83
+ SSH_AUTH_SOCK : /tmp/ssh_agent.sock
84
+ run : |
85
+ git config --global user.email "no-reply@autocloud.dev"
86
+ git config --global user.name "autocloud-deploy-bot"
87
+ yarn homebrew
0 commit comments