Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,3 @@ jobs:
uses: docker/bake-action@v2
with:
targets: releaser-build
set: |
*.cache-from=type=gha,scope=releaser
*.cache-to=type=gha,scope=releaser,mode=max
25 changes: 14 additions & 11 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,24 @@ jobs:
JEKYLL_ENV=development
DOCS_AWS_REGION=us-east-1
if [ "${{ github.ref }}" = "refs/heads/master" ]; then
DOCS_URL="https://docs-stage2.docker.com" # TODO: change this to https://docs-stage.docker.com when new env switched and ready
DOCS_URL="https://docs-stage.docker.com"
DOCS_AWS_IAM_ROLE="arn:aws:iam::710015040892:role/stage-docs-docker.github.io-20220816140248629900000003"
DOCS_S3_BUCKET="stage-docs-docker.github.io"
DOCS_S3_CONFIG="s3-config.json"
DOCS_CLOUDFRONT_ID="E1R7CSW3F0X4H8"
DOCS_LAMBDA_FUNCTION_REDIRECTS="DockerDocsRedirectFunction-stage"
DOCS_SLACK_MSG="Successfully deployed docs-stage2 from master branch. $DOCS_URL" # TODO: change to "deployed docs-stage" when new env switched and ready
DOCS_SLACK_MSG="Successfully deployed docs-stage from master branch. $DOCS_URL"
elif [ "${{ github.ref }}" = "refs/heads/published" ]; then
#JEKYLL_ENV=production # TODO: uncomment when new env switched and ready
DOCS_URL="https://docs2.docker.com" # TODO: change this to https://docs.docker.com when new env switched and ready
JEKYLL_ENV=production
DOCS_URL="https://docs.docker.com"
DOCS_AWS_IAM_ROLE="arn:aws:iam::710015040892:role/prod-docs-docker.github.io-20220816161549883800000001"
DOCS_S3_BUCKET="prod-docs-docker.github.io"
DOCS_S3_CONFIG="s3-config.json"
DOCS_CLOUDFRONT_ID="E228TTN20HNU8F"
DOCS_LAMBDA_FUNCTION_REDIRECTS="DockerDocsRedirectFunction-prod"
DOCS_SLACK_MSG="Successfully deployed docs2 from published branch. $DOCS_URL" # TODO: change to "deployed docs" when new env switched and ready
DOCS_SLACK_MSG="Successfully deployed docs from published branch. $DOCS_URL"
elif [ "${{ github.ref }}" = "refs/heads/lab" ]; then
DOCS_URL="https://docs-labs.docker.com"
DOCS_AWS_IAM_ROLE="arn:aws:iam::710015040892:role/labs-docs-docker.github.io-20220728143917865600000003"
DOCS_S3_BUCKET="labs-docs-docker.github.io"
DOCS_S3_CONFIG="s3-config.json"
DOCS_CLOUDFRONT_ID="E1MYDYF65FW3HG"
DOCS_LAMBDA_FUNCTION_REDIRECTS="DockerDocsRedirectFunction-labs"
else
Expand All @@ -60,7 +57,6 @@ jobs:
echo "DOCS_AWS_REGION=$DOCS_AWS_REGION" >> $GITHUB_ENV
echo "DOCS_AWS_IAM_ROLE=$DOCS_AWS_IAM_ROLE" >> $GITHUB_ENV
echo "DOCS_S3_BUCKET=$DOCS_S3_BUCKET" >> $GITHUB_ENV
echo "DOCS_S3_CONFIG=$DOCS_S3_CONFIG" >> $GITHUB_ENV
echo "DOCS_CLOUDFRONT_ID=$DOCS_CLOUDFRONT_ID" >> $GITHUB_ENV
echo "DOCS_LAMBDA_FUNCTION_REDIRECTS=$DOCS_LAMBDA_FUNCTION_REDIRECTS" >> $GITHUB_ENV
echo "DOCS_SLACK_MSG=$DOCS_SLACK_MSG" >> $GITHUB_ENV
Expand All @@ -79,6 +75,14 @@ jobs:
set: |
*.cache-from=type=gha,scope=deploy-${{ env.BRANCH_NAME }}
*.cache-to=type=gha,scope=deploy-${{ env.BRANCH_NAME }},mode=max
-
name: Build releaser
uses: docker/bake-action@v2
with:
targets: releaser-build
set: |
*.cache-from=type=gha,scope=releaser-${{ env.BRANCH_NAME }}
*.cache-to=type=gha,scope=releaser-${{ env.BRANCH_NAME }},mode=max
-
name: Configure AWS Credentials
if: ${{ env.DOCS_AWS_IAM_ROLE != '' }}
Expand All @@ -93,7 +97,7 @@ jobs:
aws --region ${{ env.DOCS_AWS_REGION }} s3 sync --acl public-read _site s3://${{ env.DOCS_S3_BUCKET }}/ --delete
-
name: Update S3 config
if: ${{ env.DOCS_S3_BUCKET != '' && env.DOCS_S3_CONFIG != '' }}
if: ${{ env.DOCS_S3_BUCKET != '' }}
uses: docker/bake-action@v2
with:
targets: aws-s3-update-config
Expand All @@ -102,7 +106,6 @@ jobs:
env:
AWS_REGION: ${{ env.DOCS_AWS_REGION }}
AWS_S3_BUCKET: ${{ env.DOCS_S3_BUCKET }}
AWS_S3_CONFIG: ${{ env.DOCS_S3_CONFIG }}
-
name: Update Cloudfront config
if: ${{ env.DOCS_CLOUDFRONT_ID != '' }}
Expand Down
90 changes: 0 additions & 90 deletions .github/workflows/publish.yml

This file was deleted.

3 changes: 1 addition & 2 deletions _releaser/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,12 @@ RUN --mount=type=bind,from=sitedir,target=/site \
FROM base AS aws-s3-update-config
ARG AWS_REGION
ARG AWS_S3_BUCKET
ARG AWS_S3_CONFIG
RUN --mount=type=bind,target=. \
--mount=type=bind,from=releaser,source=/out/releaser,target=/usr/bin/releaser \
--mount=type=secret,id=AWS_ACCESS_KEY_ID \
--mount=type=secret,id=AWS_SECRET_ACCESS_KEY \
--mount=type=secret,id=AWS_SESSION_TOKEN \
releaser aws s3-update-config
AWS_S3_CONFIG=s3-config.json releaser aws s3-update-config

FROM base AS aws-lambda-invoke
ARG AWS_REGION
Expand Down
Loading