-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (60 loc) · 2.33 KB
/
forge_web_deploy_dev.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
64
65
66
67
68
69
name: release_web_dev
on:
workflow_call:
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Check PR testing workflow status
id: check_status
run: |
status=$(curl -s -X GET \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/actions/workflows/pr-testing.yml/runs?event=pull_request" | jq -r '.workflow_runs[0].conclusion')
echo "Status of the latest run of pr-testing.yml: $status"
if [ "$status" = "success" ]; then
echo "The pr-testing.yml workflow was successful!"
else
echo "The pr-testing.yml workflow failed or is still in progress."
exit 1
fi
- name: Checkout
uses: actions/checkout@v2
- name: Use node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Install dependencies
run: yarn install
- name: "Build a new release of forge web"
run: |
mkdir -p /home/runner/work/forge-web/forge-web/pkg && npx harrison package
- name: "Setup twingate"
uses: twingate/github-action@v1
with:
service-key: ${{ secrets.TWINGATE_KEY }}
- name: "Deploy"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
mkdir -p ~/.ssh/
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
echo "${{ secrets.SSH_PUB_KEY }}" > ~/.ssh/id_rsa.pub
chmod 600 ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa.pub
#eval "$(ssh-agent -s)"
#ssh-add ~/.ssh/id_rsa
version=$(ls -tr pkg | tail -1)
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
echo "Starting deploy to dev"
npx harrison deploy pkg/$version --env dev
echo "Successfully deployed to dev"
- name: Comment PR
uses: thollander/actions-comment-pull-request@v2
with:
message: |
Your changes have been successfully deployed in dev, check it out: [forge web](https://forgenext-web-dev.ops.puppetlabs.net)