Skip to content

Update GitHub actions to avoid use of Node 12 #8

Update GitHub actions to avoid use of Node 12

Update GitHub actions to avoid use of Node 12 #8

---
#
# Copyright (c) 2021-2022 Red Hat, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Name is reused in `publish-netlify.yml`
name: "Build and validate pull request"
on:
- pull_request
jobs:
build:
name: "Build and validate pull request"
runs-on: ubuntu-20.04
container: "quay.io/eclipse/che-docs:latest"
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # Necessary for git diff in vale step
- name: Build using antora # and fail on warning
id: antora-build
run: CI=true antora generate antora-playbook-for-development.yml --stacktrace 2>&1 | (tee | grep WARNING && exit 42 || exit 0)
- name: Upload artifact doc-content
uses: actions/upload-artifact@v3
with:
name: doc-content
path: build/site
- name: Store PR info for publish-netlify
run: |
echo "${{ github.event.number }}" > PR_NUMBER
echo "${{ github.event.pull_request.head.sha }}" > PR_SHA
- name: Upload artifact pull-request-number for publish-netlify
uses: actions/upload-artifact@v3
with:
name: pull-request-number
path: PR_NUMBER
- name: Upload artifact pull-request-sha for publish-netlify
uses: actions/upload-artifact@v3
with:
name: pull-request-sha
path: PR_SHA
- name: Cache htmltest status code of checked external URLs # See: https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows
uses: actions/cache@v3
env:
cache-name: cache-htmltest
with:
key: refcache.json
path: .cache/htmltest
- name: Validate links using htmltest
id: validate-links
run: htmltest