11name : deploy
2-
2+ # Deploys the Docker Docs website when merging to the `main` branch.
33concurrency :
44 group : ${{ github.workflow }}-${{ github.ref }}
55 cancel-in-progress : true
88 workflow_dispatch :
99 push :
1010 branches :
11- - lab
1211 - main
13- - published
12+ - lab
1413
1514env :
1615 # Use edge release of buildx (latest RC, fallback to latest stable)
@@ -22,6 +21,8 @@ permissions:
2221 id-token : write
2322 contents : read
2423
24+ # The `main` branch is deployed to the production environment.
25+ # The `lab` branch is deployed to a separate environment for testing purposes.
2526jobs :
2627 publish :
2728 runs-on : ubuntu-24.04
@@ -30,26 +31,16 @@ jobs:
3031 -
3132 name : Prepare
3233 run : |
33- HUGO_ENV=development
3434 DOCS_AWS_REGION=us-east-1
35+ HUGO_ENV=production
3536 if [ "${{ github.ref }}" = "refs/heads/main" ]; then
36- HUGO_ENV=staging
37- DOCS_URL="https://docs-stage.docker.com"
38- DOCS_AWS_IAM_ROLE="arn:aws:iam::710015040892:role/stage-docs-docs.docker.com-20220818202135984800000001"
39- DOCS_S3_BUCKET="stage-docs-docs.docker.com"
40- DOCS_S3_CONFIG="s3-config.json"
41- DOCS_CLOUDFRONT_ID="E1R7CSW3F0X4H8"
42- DOCS_LAMBDA_FUNCTION_REDIRECTS="DockerDocsRedirectFunction-stage"
43- DOCS_SLACK_MSG="Successfully deployed docs-stage from main branch. $DOCS_URL"
44- elif [ "${{ github.ref }}" = "refs/heads/published" ]; then
45- HUGO_ENV=production
4637 DOCS_URL="https://docs.docker.com"
4738 DOCS_AWS_IAM_ROLE="arn:aws:iam::710015040892:role/prod-docs-docs.docker.com-20220818202218674300000001"
4839 DOCS_S3_BUCKET="prod-docs-docs.docker.com"
4940 DOCS_S3_CONFIG="s3-config.json"
5041 DOCS_CLOUDFRONT_ID="E228TTN20HNU8F"
5142 DOCS_LAMBDA_FUNCTION_REDIRECTS="DockerDocsRedirectFunction-prod"
52- DOCS_SLACK_MSG="Successfully deployed docs from published branch. $DOCS_URL"
43+ DOCS_SLACK_MSG="Successfully deployed docs from the main branch. $DOCS_URL"
5344 elif [ "${{ github.ref }}" = "refs/heads/lab" ]; then
5445 HUGO_ENV=lab
5546 DOCS_URL="https://docs-labs.docker.com"
0 commit comments