@@ -21,8 +21,7 @@ defaults:
21
21
shell : bash
22
22
23
23
jobs :
24
- sandbox-build-and-deploy-flex-manual :
25
- if : github.event_name != 'push' || !startsWith(github.ref, 'refs/tags/')
24
+ build-and-deploy-flex-manual :
26
25
runs-on : ubuntu-24.04
27
26
permissions :
28
27
id-token : write
@@ -43,88 +42,22 @@ jobs:
43
42
python-version : ' 3.10'
44
43
enable-cache : true
45
44
cache-dependency-glob : ' ./docs/uv.lock'
46
- - name : Sync the project
47
- working-directory : ./docs
48
- run : make setup
49
- - name : Build Flex Manual
50
- working-directory : ./docs
51
- run : make build-flex-manual
52
- - name : Deploy Flex Manual to Sandbox
53
- working-directory : ./docs
54
- run : make deploy_sandbox
55
- - name : Output URL to Summary
56
- run : |
57
- echo "## Flex Manual deployed to sandbox" >> $GITHUB_STEP_SUMMARY
58
- echo "<http://sandbox.docs.s3-website.us-east-2.amazonaws.com/${{ env.BRANCH }}/flex-manual/>" >> $GITHUB_STEP_SUMMARY
59
-
60
- staging-build-and-deploy-flex-manual :
61
- if : startsWith(github.ref, 'refs/tags/staging-')
62
- runs-on : ubuntu-24.04
63
- permissions :
64
- id-token : write
65
- contents : read
66
- env :
67
- BRANCH : ${{ github.ref_name }}
68
- steps :
69
- - name : Configure AWS Credentials
70
- uses : aws-actions/configure-aws-credentials@v4
71
- with :
72
- role-to-assume : ${{ secrets.DOCS_SANDBOX_ROLE }}
73
- aws-region : us-east-2
74
- - name : ' Checkout Repository'
75
- uses : actions/checkout@v4
76
- - name : Setup UV
77
- uses : astral-sh/setup-uv@v6
78
- with :
79
- python-version : ' 3.10'
80
- enable-cache : true
81
- cache-dependency-glob : ' ./docs/uv.lock'
82
- - name : Sync the project
83
- working-directory : ./docs
84
- run : make setup
85
- - name : Build Flex Manual
86
- working-directory : ./docs
87
- run : make build-flex-manual
88
- - name : Deploy Flex Manual to Staging
89
- working-directory : ./docs
90
- run : make deploy_staging
91
- - name : Output URL to Summary
45
+ - name : Set DEPLOY_ENV
46
+ id : set-env
92
47
run : |
93
- echo "## Flex Manual deployed to staging" >> $GITHUB_STEP_SUMMARY
94
- echo "<https://staging.docs.opentrons.com/${{ env.BRANCH }}/flex-manual/>" >> $GITHUB_STEP_SUMMARY
95
-
96
- production-build-and-deploy-flex-manual :
97
- if : startsWith(github.ref, 'refs/tags/production-')
98
- runs-on : ubuntu-24.04
99
- permissions :
100
- id-token : write
101
- contents : read
102
- env :
103
- BRANCH : ${{ github.ref_name }}
104
- steps :
105
- - name : Configure AWS Credentials
106
- uses : aws-actions/configure-aws-credentials@v4
107
- with :
108
- role-to-assume : ${{ secrets.DOCS_SANDBOX_ROLE }}
109
- aws-region : us-east-2
110
- - name : ' Checkout Repository'
111
- uses : actions/checkout@v4
112
- - name : Setup UV
113
- uses : astral-sh/setup-uv@v6
114
- with :
115
- python-version : ' 3.10'
116
- enable-cache : true
117
- cache-dependency-glob : ' ./docs/uv.lock'
48
+ if [[ "${GITHUB_REF}" == refs/tags/production-* ]]; then
49
+ echo "DEPLOY_ENV=production" >> $GITHUB_ENV
50
+ elif [[ "${GITHUB_REF}" == refs/tags/staging-* ]]; then
51
+ echo "DEPLOY_ENV=staging" >> $GITHUB_ENV
52
+ else
53
+ echo "DEPLOY_ENV=sandbox" >> $GITHUB_ENV
54
+ fi
118
55
- name : Sync the project
119
56
working-directory : ./docs
120
57
run : make setup
121
58
- name : Build Flex Manual
122
59
working-directory : ./docs
123
60
run : make build-flex-manual
124
- - name : Deploy Flex Manual to Production
61
+ - name : Deploy Flex Manual
125
62
working-directory : ./docs
126
- run : make deploy_production
127
- - name : Output URL to Summary
128
- run : |
129
- echo "## Flex Manual deployed to production" >> $GITHUB_STEP_SUMMARY
130
- echo "<https://docs.opentrons.com/${{ env.BRANCH }}/flex-manual/>" >> $GITHUB_STEP_SUMMARY
63
+ run : make deploy-flex-manual ENVIRONMENT=${{ env.DEPLOY_ENV }} BRANCH=${{ env.BRANCH }}
0 commit comments