Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test workflows #597

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 21 additions & 36 deletions .github/workflows/build_preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,31 @@ concurrency:

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

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

- name: Install dependencies
run: pip install -r requirements.txt

- name: Build
- name: Build preview website
# builds to "site" directory by default
run: |
mkdocs build -f mkdocs.yml -d site
mkdir -p pr_preview
mkdocs build -f mkdocs.yml -d pr_preview/preview

- name: Save built site
run: |
mkdir -p ./pr_site
mv site ./pr_site/.

- uses: actions/upload-artifact@v3
- name: Save built preview website
uses: actions/upload-artifact@v3
with:
name: pr_site
path: pr_site/
name: pr_preview
path: pr_preview/preview

deploy-preview:
needs: build-preview
Expand All @@ -49,47 +47,34 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

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

- name: "Download built site"
uses: actions/github-script@v3.1.0
- name: Download built preview website
uses: actions/download-artifact@v3
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: pr_preview
path: pr_preview

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

close-preview:
if: github.event.action == 'closed'
if: ${{ github.event.action == 'closed' }}
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-python@v4

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

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/mlc_config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
:w
{
"ignorePatterns": [
{
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![ACCESS-Hive Badge](docs/assets/badge.svg)](https://access-hive.org.au/)
[![github-contributors](https://img.shields.io/github/contributors/ACCESS-Hive/access-hive.github.io?color=blue&style=plastic)][github-repo]
[![forum-users](https://img.shields.io/discourse/users?color=blue&label=forum&server=https%3A%2F%2Fforum.access-hive.org.au&style=plastic)][forum]
[![Link Check](https://github.com/ACCESS-Hive/access-hive.github.io/actions/workflows/scheduled_link_check.yml/badge.svg)](https://github.com/ACCESS-Hive/access-hive.github.io/actions/workflows/scheduled_link_check.yml)
[![Link Check](https://github.com/ACCESS-Hive/access-hive.github.io/actions/workflows/check_links.yml/badge.svg)](https://github.com/ACCESS-Hive/access-hive.github.io/actions/workflows/check_links.yml)

Documentation hub for the Earth System models, ACCESS, and their community.

Expand All @@ -12,7 +12,7 @@ https://access-hive.org.au/

If you wish to add documentation to the ACCESS-Hive website see the [contribution guide](https://access-hive.org.au/about/contribute/) for instructions.

# How to Contribute [Draft]
<!-- # How to Contribute [Draft]

- Pull the latest version of `development` branch locally by using the following commands:

Expand Down Expand Up @@ -54,7 +54,7 @@ If you wish to add documentation to the ACCESS-Hive website see the [contributio

![Screenshot 2023-06-02 at 2 05 13 pm](https://github.com/ACCESS-Hive/access-hive.github.io/assets/42607679/ec141fc9-ee00-4a84-ae5a-081761400765)

- When creating a pull request (PR) please also assign a reviewer to avoid delays. For technical content please assign an expert reviewer.
- When creating a pull request (PR) please also assign a reviewer to avoid delays. For technical content please assign an expert reviewer. -->

# License
The ACCESS-Hive site is covered by [the CC-BY 4.0 license][License].
Expand Down
Loading