88jobs :
99 homebrew :
1010 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"
1116 steps :
1217 - uses : actions/checkout@v3
1318 with :
1419 fetch-depth : 0
1520 persist-credentials : false
16- token : ${{secrets.gh_token }}
21+ token : ${{secrets.GH_TOKEN }}
1722 - uses : actions/setup-node@v2
1823 with :
1924 node-version : 16
20- registry-url : ' https://registry.npmjs.org'
25+ registry-url : " https://registry.npmjs.org"
2126
2227 - name : Mkdir .aws
2328 run : mkdir -p ~/.aws
@@ -30,21 +35,22 @@ jobs:
3035 output=json
3136
3237 [profile cloudgraph-iac]
33- role_arn = $AWS_ROLE_ARN
38+ role_arn = ${{ secrets. AWS_ROLE_ARN }}
3439 source_profile = default
3540 EOF
3641 - name : Set .aws/credentials
3742 run : |
3843 cat << EOF > ~/.aws/credentials
3944 [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 }}
4247 EOF
48+
4349 - name : Get cache directory
4450 id : npm-cache-dir
4551 run : |
4652 echo "::set-output name=dir::$(npm config get cache)"
47-
53+
4854 - name : Restoring cache
4955 id : npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
5056 uses : actions/cache@v2
@@ -61,14 +67,21 @@ jobs:
6167 - name : Build
6268 run : yarn build
6369
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
6682 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 "[email protected] " 86+ git config --global user.name "autocloud-deploy-bot"
87+ yarn homebrew
0 commit comments