Files
docker-docs/.github/workflows/build-pr.yml
Sebastiaan van Stijn 9400eb58e9 gha: split link-check to separate job
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-10-13 16:33:58 +02:00

48 lines
1.9 KiB
YAML

name: build docker image when PR is opened
on: pull_request
jobs:
build-static-page:
name: build
runs-on: ubuntu-18.04
env:
DOCKER_BUILDKIT: '1'
steps:
- name: print docker info
run: docker version && docker info
- uses: actions/checkout@v2
- name: build image
run: docker build --target=current -t documentation:latest .
validate:
name: validate links
runs-on: ubuntu-18.04
env:
DOCKER_BUILDKIT: '1'
steps:
- name: print docker info
run: docker version && docker info
- uses: actions/checkout@v2
- name: copy files to host
run: docker build --target=deploy-source --output=./_site .
- name: check for broken links
uses: chabad360/htmlproofer@master
with:
directory: ./_site
# for available options, refer to:
# - https://github.com/gjtorikian/html-proofer
# - https://github.com/gjtorikian/html-proofer/blob/main/bin/htmlproofer
arguments: --disable-external --internal-domains="docs.docker.com,docs-stage.docker.com,localhost:4000" --file-ignore="/^./_site/engine/api/.*$/,./_site/registry/configuration/index.html" --url-ignore="/^/docker-hub/api/latest/.*$/,/^/engine/api/v.+/#.*$/,/^/glossary/.*$/"
# 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 }}"