Skip to content

Commit

Permalink
Merge branch 'main' of github.com:ACCESS-Hive/access-hive.github.io i…
Browse files Browse the repository at this point in the history
…nto development
  • Loading branch information
atteggiani committed Oct 4, 2023
2 parents 3712418 + 92ec2e0 commit d8f6939
Show file tree
Hide file tree
Showing 10 changed files with 125 additions and 191 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: 3.x

Expand All @@ -28,7 +28,7 @@ jobs:
run: |
mkdocs build -f mkdocs.yml -d site
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: development
path: development/
Expand All @@ -37,7 +37,7 @@ jobs:
run: |
mkdir -p ./development_site
mv site ./development_site/.
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: development_site
path: development_site/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: 3.x

Expand Down
75 changes: 63 additions & 12 deletions .github/workflows/build_preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@ on:
- opened
- reopened
- synchronize
- closed

concurrency:
group: preview-${{ github.ref }}
cancel-in-progress: true

jobs:
build-preview:
if: github.event.action != "closed"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: 3.x

Expand All @@ -29,22 +31,71 @@ jobs:
# builds to "site" directory by default
run: |
mkdocs build -f mkdocs.yml -d site
- name: Save PR number
run: |
mkdir -p ./pr
echo ${{ github.event.number }} > ./pr/NB
- uses: actions/upload-artifact@v2
with:
name: pr
path: pr/

- name: Save built site
run: |
mkdir -p ./pr_site
mv site ./pr_site/.
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: pr_site
path: pr_site/

deploy-preview:
needs: build-preview
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: 3.x

- name: "Download built site"
uses: actions/[email protected]
with:
script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "pr_site"
})[0];
var download = await github.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
var fs = require('fs');
fs.writeFileSync('${{github.workspace}}/pr_site.zip', Buffer.from(download.data));
- run: unzip pr_site.zip

- name: Deploy preview
uses: access-nri/[email protected]
with:
source-dir: site
action: deploy
pr-number: ${{ github.event.number }}

close-preview:
if: github.event.action == "closed"
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x

- name: Clean preview
uses: access-nri/[email protected]
with:
action: remove
pr-number: ${{ github.event.number }}

22 changes: 21 additions & 1 deletion .github/workflows/check_links.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
name: Check Markdown links

on: push
on:
push:
schedule:
# Run at 03:07 every Sunday
- cron: "7 3 * * SUN"
workflow_dispatch:

jobs:
markdown-link-check:
if: ${{ github.event_name != 'schedule' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
Expand All @@ -13,5 +19,19 @@ jobs:
folder-path: 'docs'
# Only check links in modified files to reduce false positives
check-modified-files-only: 'yes'
use-quiet-mode: 'no'
use-verbose-mode: 'yes'
base-branch: 'main'
full-markdown-link-check:
if: ${{ github.event_name == 'schedule' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: 'no'
use-verbose-mode: 'yes'
config-file: '.github/workflows/mlc_config.json'
folder-path: 'docs'
base-branch: 'main'

52 changes: 0 additions & 52 deletions .github/workflows/clean_preview.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/close_pr.yml

This file was deleted.

76 changes: 0 additions & 76 deletions .github/workflows/deploy_preview.yml

This file was deleted.

Loading

0 comments on commit d8f6939

Please sign in to comment.