Skip to content

Commit

Permalink
fix: cleanup workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
themr0c committed Oct 21, 2021
1 parent cd7aa14 commit f1253cd
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@
#
# SPDX-License-Identifier: EPL-2.0
#
# Add Web IDE link on PRs
name: web-ide

# Add Web IDE link on pull requests
name: Add Web IDE link
on:
pull_request_target:
types: [opened, synchronize]

types:
- opened
- synchronize
jobs:
add-link:
name: Add Web IDE link
runs-on: ubuntu-20.04
steps:
- name: Web IDE Pull Request Check
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/build-and-publish-to-github-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
name: Publish to GitHub Pages
on:
push:
branches: [main]
branches:
- main
jobs:
build:
publish:
name: Publish to GitHub Pages
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/build-and-validate-on-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@
#

# Name is reused in `publish-netlify.yml`
name: "Build and validate pull request"

name: Build and validate pull request
on:
- pull_request

jobs:
build:
name: "Build and validate pull request"
name: Build and validate pull request
runs-on: ubuntu-20.04
container: "quay.io/eclipse/che-docs:latest"
steps:
Expand All @@ -28,38 +26,32 @@ jobs:
- 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@v2
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@v2
with:
name: pull-request-number
path: PR_NUMBER

- name: Upload artifact pull-request-sha for publish-netlify
uses: actions/upload-artifact@v2
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@v2
env:
cache-name: cache-htmltest
with:
key: refcache.json
path: .cache/htmltest

- name: Validate links using htmltest
id: validate-links
run: htmltest
8 changes: 2 additions & 6 deletions .github/workflows/build-and-validate-on-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,34 @@
# GitHub Actions configuration file for htmltest
# See: https://github.com/wjdp/htmltest

name: Build and validate
name: Build and validate on push
on:
- push
jobs:
build:
name: Build and validate
name: Build and validate on push
runs-on: ubuntu-20.04
container: "quay.io/eclipse/che-docs:latest"
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Build using antora
id: antora-build
run: CI=true antora generate antora-playbook-for-development.yml --stacktrace

- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: doc-content
path: build/site

- 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@v2
env:
cache-name: cache-htmltest
with:
key: refcache.json
path: .cache/htmltest

- name: Validate links using htmltest
id: validate-links
run: htmltest
4 changes: 1 addition & 3 deletions .github/workflows/publish-netlify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@

# NOTE: Because this worklow is using secrets, it cannot run directly on a pull-request workflow, which is running in the context of the forked repository.

name: Publish doc-content using netlify

name: Publish pull request doc-content using netlify
on:
workflow_run:
workflows:
- "Build and validate pull request"
types:
- completed

jobs:
publish:
name: Publish doc-content using netlify
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
---
#
# Copyright (c) 2021 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
name: Release
on:
push:
branches:
- main
jobs:
prose:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/vale.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
---
#
# Copyright (c) 2021 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
name: Linting with Vale
on:
- pull_request
- push
jobs:
prose:
vale:
name: Linting with Vale
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master

- name: Vale Linter
uses: errata-ai/[email protected]
with:
Expand Down
4 changes: 3 additions & 1 deletion .vale.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ SkippedScopes = script, style, pre, figure, code, tt, blockquote, listingblock,
properties = md

# Match AsciiDoc files. See: https://docs.errata.ai/vale/scoping
[*.adoc]
# Ignore files in a directory starting by `.`
# to avoid raising errors for `.vale/fixtures/*/testinvalid.adoc` files
[[!.]*.adoc]
# Styles to load, located in the `StylesPath` folder:
BasedOnStyles = RedHat

Expand Down
1 change: 0 additions & 1 deletion _config.yml

This file was deleted.

0 comments on commit f1253cd

Please sign in to comment.