-
Notifications
You must be signed in to change notification settings - Fork 37
/
action.yaml
48 lines (44 loc) · 1.5 KB
/
action.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: "Build with cached packs"
inputs:
gh-token:
description: "GitHub Token for authentication"
required: true
runs:
using: "composite"
steps:
- name: Install jq (JSON processor) if not found
run: |
if ! command -v jq &> /dev/null; then
sudo apt-get update
sudo apt-get install -y jq
else
echo "jq is already installed. Skipping install..."
fi
shell: bash
- name: Download Packs Data
run: |
# Find the latest packs upload workflow.
run_id=$(gh run list --workflow="post_release.yaml" --limit 1 --json databaseId | jq -r '.[0].databaseId')
# Remove any downloaded artifacts, should they exist.
rm -rf ./downloaded_artifacts
# Download the latest artifact to a new dir.
gh run download ${run_id} --name build-packs --dir ./downloaded_artifacts
shell: bash
env:
GH_TOKEN: ${{ inputs.gh-token }}
- name: Unpack packs data
run: |
# Ensure the correct folders exist.
mkdir -p .docusaurus/packs-integrations
# Move the files to their correct places in the checked out repository
mv downloaded_artifacts/.docusaurus/packs-integrations/* .docusaurus/packs-integrations
mkdir -p static/img/packs
mv downloaded_artifacts/build/packs/* static/img/packs
# Clean up.
rm -rf downloaded_artifacts
shell: bash
- name: Build
run: |
rm -rf build
npm run build
shell: bash