Skip to content

Commit 641a4bc

Browse files
committed
few changes
1 parent b48e1d6 commit 641a4bc

File tree

2 files changed

+15
-90
lines changed

2 files changed

+15
-90
lines changed

.github/workflows/docs-build-deploy.yaml

Lines changed: 12 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ defaults:
2121
shell: bash
2222

2323
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:
2625
runs-on: ubuntu-24.04
2726
permissions:
2827
id-token: write
@@ -43,88 +42,22 @@ jobs:
4342
python-version: '3.10'
4443
enable-cache: true
4544
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
9247
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
11855
- name: Sync the project
11956
working-directory: ./docs
12057
run: make setup
12158
- name: Build Flex Manual
12259
working-directory: ./docs
12360
run: make build-flex-manual
124-
- name: Deploy Flex Manual to Production
61+
- name: Deploy Flex Manual
12562
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 }}

docs/Makefile

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,6 @@ serve-flex-manual:
1414
build-flex-manual:
1515
uv run mkdocs build -f $(FLEX_MANUAL_PREFIX)/mkdocs.yml
1616

17-
.PHONY: deploy_sandbox
18-
deploy_sandbox:
19-
python deploy_flex_manual.py sandbox --branch ${{ env.BRANCH }}
20-
21-
.PHONY: deploy_staging
22-
deploy_staging:
23-
python deploy_flex_manual.py staging --branch ${{ env.BRANCH }}
24-
25-
.PHONY: deploy_production
26-
deploy_production:
27-
python deploy_flex_manual.py production --branch ${{ env.BRANCH }}
17+
.PHONY: deploy-flex-manual
18+
deploy-flex-manual:
19+
python deploy_flex_manual.py $(ENVIRONMENT) --branch $(BRANCH)

0 commit comments

Comments
 (0)