mirror of
https://github.com/docker/docs.git
synced 2026-03-27 14:28:47 +07:00
ci: deploy from main (#23084)
PR that changes the deploy workflow of the docs. ## What has changed? This PR simplifies the deployment flow by deleting our staging build. We publish what is on the main branch instead of relying on the `publish` and `publish-update` branches.
This commit is contained in:
21
.github/workflows/deploy.yml
vendored
21
.github/workflows/deploy.yml
vendored
@@ -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,8 @@ on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- lab
|
||||
- main
|
||||
- published
|
||||
- lab
|
||||
|
||||
env:
|
||||
# Use edge release of buildx (latest RC, fallback to latest stable)
|
||||
@@ -22,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,26 +31,16 @@ jobs:
|
||||
-
|
||||
name: Prepare
|
||||
run: |
|
||||
HUGO_ENV=development
|
||||
DOCS_AWS_REGION=us-east-1
|
||||
HUGO_ENV=production
|
||||
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"
|
||||
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"
|
||||
|
||||
35
.github/workflows/merge.yml
vendored
35
.github/workflows/merge.yml
vendored
@@ -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.
|
||||
Reference in New Issue
Block a user