Skip to content

release: build docs as container image #13807

release: build docs as container image

release: build docs as container image #13807

Workflow file for this run

name: build
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
IMAGE_NAME: "docs/docker-docs"
on:
push:
# needs push event on default branch otherwise cache is evicted when pull request is merged
branches:
- main
pull_request:
env:

Check failure on line 17 in .github/workflows/build.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/build.yml

Invalid workflow file

You have an error in your yaml syntax on line 17
# Use edge release of buildx (latest RC, fallback to latest stable)
SETUP_BUILDX_VERSION: edge
SETUP_BUILDKIT_IMAGE: "moby/buildkit:latest"
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
releaser:
runs-on: ubuntu-24.04
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: ${{ env.SETUP_BUILDX_VERSION }}
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
-
name: Build
uses: docker/bake-action@v5
with:
files: |
docker-bake.hcl
targets: releaser-build
set: |
*.cache-from=type=gha,scope=releaser
*.cache-to=type=gha,scope=releaser,mode=max
build:
runs-on: ubuntu-24.04
needs:
- releaser
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build
uses: docker/bake-action@v5
with:
files: |
docker-bake.hcl
targets: release
set: |
*.cache-from=type=gha,scope=build
*.cache-to=type=gha,scope=build,mode=max
-
name: Check Cloudfront config
uses: docker/bake-action@v5
with:
targets: aws-cloudfront-update
env:
DRY_RUN: true
AWS_REGION: us-east-1
AWS_CLOUDFRONT_ID: 0123456789ABCD
AWS_LAMBDA_FUNCTION: DockerDocsRedirectFunction-dummy
vale:
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: errata-ai/vale-action@reviewdog
env:
PIP_BREAK_SYSTEM_PACKAGES: 1
with:
files: content
validate:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
target:
- lint
- test
- unused-media
- test-go-redirects
- dockerfile-lint
- path-warnings
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Validate
uses: docker/bake-action@v5
with:
files: |
docker-bake.hcl
targets: ${{ matrix.target }}
set: |
*.cache-to=type=gha,scope=validate-${{ matrix.target }},mode=max
*.cache-from=type=gha,scope=validate-${{ matrix.target }}
*.cache-from=type=gha,scope=build
image:
runs-on: ubuntu-24.04
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Docker meta
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
with:
images: ${{ env.IMAGE_NAME }}
-
if: ${{ github.event_name != 'pull_request' }}
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
-
name: Build website image
uses: docker/bake-action@v5
with:
files: |
docker-bake.hcl
${{ steps.meta.outputs.bake-file-tags }}
${{ steps.meta.outputs.bake-file-annotations }}
targets: image
set: |
*.cache-from=type=gha,scope=deploy-${{ env.BRANCH_NAME }}
*.cache-to=type=gha,scope=deploy-${{ env.BRANCH_NAME }},mode=max
push: ${{ github.event_name != 'pull_request' }}