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
1412
1513env :
1614 # Use edge release of buildx (latest RC, fallback to latest stable)
@@ -30,38 +28,16 @@ jobs:
3028 -
3129 name : Prepare
3230 run : |
33- HUGO_ENV=development
3431 DOCS_AWS_REGION=us-east-1
35- 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- DOCS_URL="https://docs.docker.com"
47- DOCS_AWS_IAM_ROLE="arn:aws:iam::710015040892:role/prod-docs-docs.docker.com-20220818202218674300000001"
48- DOCS_S3_BUCKET="prod-docs-docs.docker.com"
49- DOCS_S3_CONFIG="s3-config.json"
50- DOCS_CLOUDFRONT_ID="E228TTN20HNU8F"
51- DOCS_LAMBDA_FUNCTION_REDIRECTS="DockerDocsRedirectFunction-prod"
52- DOCS_SLACK_MSG="Successfully deployed docs from published branch. $DOCS_URL"
53- elif [ "${{ github.ref }}" = "refs/heads/lab" ]; then
54- HUGO_ENV=lab
55- DOCS_URL="https://docs-labs.docker.com"
56- DOCS_AWS_IAM_ROLE="arn:aws:iam::710015040892:role/labs-docs-docs.docker.com-20220818202218402500000001"
57- DOCS_S3_BUCKET="labs-docs-docs.docker.com"
58- DOCS_S3_CONFIG="s3-config.json"
59- DOCS_CLOUDFRONT_ID="E1MYDYF65FW3HG"
60- DOCS_LAMBDA_FUNCTION_REDIRECTS="DockerDocsRedirectFunction-labs"
61- else
62- echo >&2 "ERROR: unknown branch ${{ github.ref }}"
63- exit 1
64- fi
32+ 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+
6541 SEND_SLACK_MSG="true"
6642 if [ -z "$DOCS_AWS_IAM_ROLE" ] || [ -z "$DOCS_S3_BUCKET" ] || [ -z "$DOCS_CLOUDFRONT_ID" ] || [ -z "$DOCS_SLACK_MSG" ]; then
6743 SEND_SLACK_MSG="false"
0 commit comments