Skip to content
Merged
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
8 changes: 2 additions & 6 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
.dockerignore
.DS_Store
.git
.github
.gitignore
.gitmodules
.idea
.jekyll-cache
.jekyll-metadata
.sass-cache
tests
_site
CONTRIBUTING.md
Dockerfile
Dockerfile.archive
docker-compose.yml
Gemfile
Gemfile.lock
_website*.json

/vendor
48 changes: 0 additions & 48 deletions .github/workflows/build-master.yml

This file was deleted.

47 changes: 0 additions & 47 deletions .github/workflows/build-pr.yml

This file was deleted.

48 changes: 0 additions & 48 deletions .github/workflows/build-published.yml

This file was deleted.

102 changes: 102 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: build

on:
push:
branches:
- master
- published
pull_request:

jobs:
release:
runs-on: ubuntu-20.04
steps:
-
name: Prepare
run: |
JEKYLL_ENV=development
if [ "${{ github.ref }}" = "refs/heads/master" ]; then
DOCS_S3_HOST="docs.docker.com-stage-us-east-1"
DOCS_AWS_LAMBDA="arn:aws:lambda:us-east-1:710015040892:function:docs-stage-cache-invalidator"
DOCS_SLACK_MSG="Successfully promoted docs-stage from master. https://docs-stage.docker.com/"
DOCS_WEBCONFIG="_website-config-docs-stage.json"
elif [ "${{ github.ref }}" = "refs/heads/published" ]; then
JEKYLL_ENV=production
DOCS_S3_HOST="docs.docker.com-us-east-1"
DOCS_AWS_LAMBDA="arn:aws:lambda:us-east-1:710015040892:function:docs-cache-invalidator"
DOCS_SLACK_MSG="Successfully published docs. https://docs.docker.com/"
DOCS_WEBCONFIG="_website-config-docs.json"
fi
echo "JEKYLL_ENV=$JEKYLL_ENV" >> $GITHUB_ENV
echo "DOCS_S3_HOST=$DOCS_S3_HOST" >> $GITHUB_ENV
echo "DOCS_AWS_LAMBDA=$DOCS_AWS_LAMBDA" >> $GITHUB_ENV
echo "DOCS_SLACK_MSG=$DOCS_SLACK_MSG" >> $GITHUB_ENV
echo "DOCS_WEBCONFIG=$DOCS_WEBCONFIG" >> $GITHUB_ENV
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build
uses: docker/bake-action@v2
with:
targets: release
-
name: Upload files to S3 bucket
if: github.event_name != 'pull_request'
run: |
aws s3 sync --acl public-read _site s3://${{ env.DOCS_S3_HOST }}/ --delete
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
-
name: Update S3 website config
if: github.event_name != 'pull_request'
uses: ./.github/actions/update-website-config
with:
bucketName: ${{ env.DOCS_S3_HOST }}
regionName: us-east-1
websiteConfig: ${{ env.DOCS_WEBCONFIG }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
-
name: Invalidate docs website cache
if: github.event_name != 'pull_request'
run: |
aws --region us-east-1 lambda invoke --function-name ${{ env.DOCS_AWS_LAMBDA }} response.json
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
-
name: Send Slack notification
if: github.event_name != 'pull_request'
run: |
curl -X POST -H 'Content-type: application/json' --data '{"text":"${{ env.DOCS_SLACK_MSG }}"}' ${{ secrets.SLACK_WEBHOOK }}

validate:
runs-on: ubuntu-20.04
if: github.event_name == 'pull_request'
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Check for broken links
uses: docker/bake-action@v2
with:
targets: htmlproofer

# Disabled netlify-deploy due to flakey 502 http errors
# - name: copy static files
# if: github.event.pull_request.head.repo.fork == false
# run: docker run -v ${PWD}:/output documentation:latest cp -r /usr/share/nginx/html /output/_site
# - uses: ./.github/actions/netlify-deploy
# if: github.event.pull_request.head.repo.fork == false
# with:
# directory: _site
# netlify_token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
# netlify_account_slug: ${{ secrets.NETLIFY_ACCOUNT_SLUG }}
# site_name: "${{ github.repository }}/${{ github.head_ref }}"
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
**/.DS_Store
**/desktop.ini
.bundle/**
.jekyll-cache
.jekyll-metadata
_site/**
.sass-cache/**
CNAME
Gemfile.lock
_kbase/**
/vendor
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.6
2.6.10
Loading