1
1
name : deploy
2
-
2
+ # Deploys the Docker Docs website when merging to the `main` branch.
3
3
concurrency :
4
4
group : ${{ github.workflow }}-${{ github.ref }}
5
5
cancel-in-progress : true
8
8
workflow_dispatch :
9
9
push :
10
10
branches :
11
- - lab
12
11
- main
13
- - published
12
+ - lab
14
13
15
14
env :
16
15
# Use edge release of buildx (latest RC, fallback to latest stable)
@@ -22,6 +21,8 @@ permissions:
22
21
id-token : write
23
22
contents : read
24
23
24
+ # The `main` branch is deployed to the production environment.
25
+ # The `lab` branch is deployed to a separate environment for testing purposes.
25
26
jobs :
26
27
publish :
27
28
runs-on : ubuntu-24.04
@@ -30,26 +31,16 @@ jobs:
30
31
-
31
32
name : Prepare
32
33
run : |
33
- HUGO_ENV=development
34
34
DOCS_AWS_REGION=us-east-1
35
+ HUGO_ENV=production
35
36
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
46
37
DOCS_URL="https://docs.docker.com"
47
38
DOCS_AWS_IAM_ROLE="arn:aws:iam::710015040892:role/prod-docs-docs.docker.com-20220818202218674300000001"
48
39
DOCS_S3_BUCKET="prod-docs-docs.docker.com"
49
40
DOCS_S3_CONFIG="s3-config.json"
50
41
DOCS_CLOUDFRONT_ID="E228TTN20HNU8F"
51
42
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"
53
44
elif [ "${{ github.ref }}" = "refs/heads/lab" ]; then
54
45
HUGO_ENV=lab
55
46
DOCS_URL="https://docs-labs.docker.com"
0 commit comments