From 0158dd8baf56564c6b84df23f4197d2ea2684701 Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 14 Jul 2025 11:27:16 +0200 Subject: [PATCH 1/3] update: deploy on push to main --- .github/workflows/deploy.yml | 44 ++++++++---------------------------- 1 file changed, 10 insertions(+), 34 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 24686bf84ea7..505a701f780a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,5 +1,5 @@ name: deploy - +# Deploys the Docker Docs website when merging to the `main` branch. concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -8,9 +8,7 @@ on: workflow_dispatch: push: branches: - - lab - main - - published env: # Use edge release of buildx (latest RC, fallback to latest stable) @@ -30,38 +28,16 @@ jobs: - name: Prepare run: | - HUGO_ENV=development DOCS_AWS_REGION=us-east-1 - if [ "${{ github.ref }}" = "refs/heads/main" ]; then - HUGO_ENV=staging - DOCS_URL="https://docs-stage.docker.com" - DOCS_AWS_IAM_ROLE="arn:aws:iam::710015040892:role/stage-docs-docs.docker.com-20220818202135984800000001" - DOCS_S3_BUCKET="stage-docs-docs.docker.com" - DOCS_S3_CONFIG="s3-config.json" - DOCS_CLOUDFRONT_ID="E1R7CSW3F0X4H8" - DOCS_LAMBDA_FUNCTION_REDIRECTS="DockerDocsRedirectFunction-stage" - DOCS_SLACK_MSG="Successfully deployed docs-stage from main branch. $DOCS_URL" - elif [ "${{ github.ref }}" = "refs/heads/published" ]; then - HUGO_ENV=production - DOCS_URL="https://docs.docker.com" - DOCS_AWS_IAM_ROLE="arn:aws:iam::710015040892:role/prod-docs-docs.docker.com-20220818202218674300000001" - DOCS_S3_BUCKET="prod-docs-docs.docker.com" - DOCS_S3_CONFIG="s3-config.json" - DOCS_CLOUDFRONT_ID="E228TTN20HNU8F" - DOCS_LAMBDA_FUNCTION_REDIRECTS="DockerDocsRedirectFunction-prod" - DOCS_SLACK_MSG="Successfully deployed docs from published branch. $DOCS_URL" - elif [ "${{ github.ref }}" = "refs/heads/lab" ]; then - HUGO_ENV=lab - DOCS_URL="https://docs-labs.docker.com" - DOCS_AWS_IAM_ROLE="arn:aws:iam::710015040892:role/labs-docs-docs.docker.com-20220818202218402500000001" - DOCS_S3_BUCKET="labs-docs-docs.docker.com" - DOCS_S3_CONFIG="s3-config.json" - DOCS_CLOUDFRONT_ID="E1MYDYF65FW3HG" - DOCS_LAMBDA_FUNCTION_REDIRECTS="DockerDocsRedirectFunction-labs" - else - echo >&2 "ERROR: unknown branch ${{ github.ref }}" - exit 1 - fi + HUGO_ENV=production + DOCS_URL="https://docs.docker.com" + DOCS_AWS_IAM_ROLE="arn:aws:iam::710015040892:role/prod-docs-docs.docker.com-20220818202218674300000001" + DOCS_S3_BUCKET="prod-docs-docs.docker.com" + DOCS_S3_CONFIG="s3-config.json" + DOCS_CLOUDFRONT_ID="E228TTN20HNU8F" + DOCS_LAMBDA_FUNCTION_REDIRECTS="DockerDocsRedirectFunction-prod" + DOCS_SLACK_MSG="Successfully deployed docs from the main branch. $DOCS_URL" + SEND_SLACK_MSG="true" if [ -z "$DOCS_AWS_IAM_ROLE" ] || [ -z "$DOCS_S3_BUCKET" ] || [ -z "$DOCS_CLOUDFRONT_ID" ] || [ -z "$DOCS_SLACK_MSG" ]; then SEND_SLACK_MSG="false" From 11824bc82799e1186843ec8f1143dea262686d59 Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 14 Jul 2025 11:27:27 +0200 Subject: [PATCH 2/3] delete merge job --- .github/workflows/merge.yml | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 .github/workflows/merge.yml diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml deleted file mode 100644 index 7b842d08e746..000000000000 --- a/.github/workflows/merge.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: merge - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -# open or update publishing PR when there is a push to main -on: - workflow_dispatch: - push: - branches: - - main - -jobs: - main-to-published: - runs-on: ubuntu-24.04 - if: github.repository_owner == 'docker' - steps: - - uses: actions/checkout@v4 - with: - ref: published - - name: Reset published branch - run: | - git fetch origin main:main - git reset --hard main - - name: Create Pull Request - uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e - with: - delete-branch: false - branch: published-update - commit-message: publish updates from main - labels: area/release - title: publish updates from main - body: | - Automated pull request for publishing docs updates. From 8188ae878a14377b1fe20e1d998a7fe47df729ff Mon Sep 17 00:00:00 2001 From: Arthur Date: Tue, 15 Jul 2025 16:56:34 +0200 Subject: [PATCH 3/3] keep lab path --- .github/workflows/deploy.yml | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 505a701f780a..793149808716 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,6 +9,7 @@ on: push: branches: - main + - lab env: # Use edge release of buildx (latest RC, fallback to latest stable) @@ -20,6 +21,8 @@ permissions: id-token: write contents: read +# The `main` branch is deployed to the production environment. +# The `lab` branch is deployed to a separate environment for testing purposes. jobs: publish: runs-on: ubuntu-24.04 @@ -30,14 +33,26 @@ jobs: run: | DOCS_AWS_REGION=us-east-1 HUGO_ENV=production - DOCS_URL="https://docs.docker.com" - DOCS_AWS_IAM_ROLE="arn:aws:iam::710015040892:role/prod-docs-docs.docker.com-20220818202218674300000001" - DOCS_S3_BUCKET="prod-docs-docs.docker.com" - DOCS_S3_CONFIG="s3-config.json" - DOCS_CLOUDFRONT_ID="E228TTN20HNU8F" - DOCS_LAMBDA_FUNCTION_REDIRECTS="DockerDocsRedirectFunction-prod" - DOCS_SLACK_MSG="Successfully deployed docs from the main branch. $DOCS_URL" - + if [ "${{ github.ref }}" = "refs/heads/main" ]; then + DOCS_URL="https://docs.docker.com" + DOCS_AWS_IAM_ROLE="arn:aws:iam::710015040892:role/prod-docs-docs.docker.com-20220818202218674300000001" + DOCS_S3_BUCKET="prod-docs-docs.docker.com" + DOCS_S3_CONFIG="s3-config.json" + DOCS_CLOUDFRONT_ID="E228TTN20HNU8F" + DOCS_LAMBDA_FUNCTION_REDIRECTS="DockerDocsRedirectFunction-prod" + DOCS_SLACK_MSG="Successfully deployed docs from the main branch. $DOCS_URL" + elif [ "${{ github.ref }}" = "refs/heads/lab" ]; then + HUGO_ENV=lab + DOCS_URL="https://docs-labs.docker.com" + DOCS_AWS_IAM_ROLE="arn:aws:iam::710015040892:role/labs-docs-docs.docker.com-20220818202218402500000001" + DOCS_S3_BUCKET="labs-docs-docs.docker.com" + DOCS_S3_CONFIG="s3-config.json" + DOCS_CLOUDFRONT_ID="E1MYDYF65FW3HG" + DOCS_LAMBDA_FUNCTION_REDIRECTS="DockerDocsRedirectFunction-labs" + else + echo >&2 "ERROR: unknown branch ${{ github.ref }}" + exit 1 + fi SEND_SLACK_MSG="true" if [ -z "$DOCS_AWS_IAM_ROLE" ] || [ -z "$DOCS_S3_BUCKET" ] || [ -z "$DOCS_CLOUDFRONT_ID" ] || [ -z "$DOCS_SLACK_MSG" ]; then SEND_SLACK_MSG="false"