Skip to content

Commit 396fb34

Browse files
committed
keep lab path
1 parent 11824bc commit 396fb34

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

.github/workflows/deploy.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ permissions:
2020
id-token: write
2121
contents: read
2222

23+
# The `main` branch is deployed to the production environment.
24+
# The `lab` branch is deployed to a separate environment for testing purposes.
2325
jobs:
2426
publish:
2527
runs-on: ubuntu-24.04
@@ -30,14 +32,26 @@ jobs:
3032
run: |
3133
DOCS_AWS_REGION=us-east-1
3234
HUGO_ENV=production
33-
DOCS_URL="https://docs.docker.com"
34-
DOCS_AWS_IAM_ROLE="arn:aws:iam::710015040892:role/prod-docs-docs.docker.com-20220818202218674300000001"
35-
DOCS_S3_BUCKET="prod-docs-docs.docker.com"
36-
DOCS_S3_CONFIG="s3-config.json"
37-
DOCS_CLOUDFRONT_ID="E228TTN20HNU8F"
38-
DOCS_LAMBDA_FUNCTION_REDIRECTS="DockerDocsRedirectFunction-prod"
39-
DOCS_SLACK_MSG="Successfully deployed docs from the main branch. $DOCS_URL"
40-
35+
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
36+
DOCS_URL="https://docs.docker.com"
37+
DOCS_AWS_IAM_ROLE="arn:aws:iam::710015040892:role/prod-docs-docs.docker.com-20220818202218674300000001"
38+
DOCS_S3_BUCKET="prod-docs-docs.docker.com"
39+
DOCS_S3_CONFIG="s3-config.json"
40+
DOCS_CLOUDFRONT_ID="E228TTN20HNU8F"
41+
DOCS_LAMBDA_FUNCTION_REDIRECTS="DockerDocsRedirectFunction-prod"
42+
DOCS_SLACK_MSG="Successfully deployed docs from the main branch. $DOCS_URL"
43+
elif [ "${{ github.ref }}" = "refs/heads/lab" ]; then
44+
HUGO_ENV=lab
45+
DOCS_URL="https://docs-labs.docker.com"
46+
DOCS_AWS_IAM_ROLE="arn:aws:iam::710015040892:role/labs-docs-docs.docker.com-20220818202218402500000001"
47+
DOCS_S3_BUCKET="labs-docs-docs.docker.com"
48+
DOCS_S3_CONFIG="s3-config.json"
49+
DOCS_CLOUDFRONT_ID="E1MYDYF65FW3HG"
50+
DOCS_LAMBDA_FUNCTION_REDIRECTS="DockerDocsRedirectFunction-labs"
51+
else
52+
echo >&2 "ERROR: unknown branch ${{ github.ref }}"
53+
exit 1
54+
fi
4155
SEND_SLACK_MSG="true"
4256
if [ -z "$DOCS_AWS_IAM_ROLE" ] || [ -z "$DOCS_S3_BUCKET" ] || [ -z "$DOCS_CLOUDFRONT_ID" ] || [ -z "$DOCS_SLACK_MSG" ]; then
4357
SEND_SLACK_MSG="false"

0 commit comments

Comments
 (0)