Skip to content

Commit 8188ae8

Browse files
committed
keep lab path
1 parent 11824bc commit 8188ae8

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

.github/workflows/deploy.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
push:
1010
branches:
1111
- main
12+
- lab
1213

1314
env:
1415
# Use edge release of buildx (latest RC, fallback to latest stable)
@@ -20,6 +21,8 @@ permissions:
2021
id-token: write
2122
contents: read
2223

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

0 commit comments

Comments
 (0)