Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 1 addition & 1 deletion .firebaserc
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"projects": {
"default": "astar-docs"
}
}
}
32 changes: 32 additions & 0 deletions .github/actions/setup-workspace/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Setup Workspace
description: Setup Node.js, Yarn v4 with Corepack, and install dependencies
inputs:
build:
description: 'Whether to run `yarn build` after install'
required: false
default: 'false'
runs:
using: composite
steps:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 22.x
cache: yarn

- name: Enable Corepack
run: corepack enable
shell: bash

- name: Prepare Yarn
run: corepack prepare yarn@4.9.2 --activate
shell: bash

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like these lines need to be running before setup-node. If they fail to run due to node not being installed, maybe do setup-node twice with the first one not doing the cache. Still, I feel like there's a better way to do this overall

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JGJP Thank you for your comment. In that case, based on the context you provided, I believe running setup-node twice will be the most effective and clean solution for now. The implementation would look like this:

name: Setup Workspace
description: Setup Node.js, Yarn v4 with Corepack, and install dependencies
inputs:
  build:
    description: 'Whether to run `yarn build` after install'
    required: false
    default: 'false'

runs:
  using: composite
  steps:
    # Step 1: Setup Node.js without Yarn cache (just to activate Corepack/Yarn)
    - name: Setup Node.js (no cache)
      uses: actions/setup-node@v3
      with:
        node-version: 22.x
        cache: false

    - name: Enable Corepack
      run: corepack enable
      shell: bash

    - name: Prepare Yarn 4.9.2
      run: corepack prepare yarn@4.9.2 --activate
      shell: bash

    # Step 2: Setup Node.js again — now with Yarn cache enabled
    - name: Setup Node.js (with Yarn cache)
      uses: actions/setup-node@v3
      with:
        node-version: 22.x
        cache: yarn

    - name: Install dependencies with Yarn
      run: yarn install --immutable
      shell: bash

    - name: Build project (optional)
      if: inputs.build == 'true'
      run: yarn build
      shell: bash

@JGJP what do you think?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, let's try it and see if the build runs

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it's building, there's some error about Buffer but seems unrelated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it worked!

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might be able to get away with removing the yarn preparation step


- name: Install dependencies with Yarn
run: yarn install --frozen-lockfile
shell: bash

- name: Build project (optional)
if: inputs.build == 'true'
run: yarn build
shell: bash
2 changes: 1 addition & 1 deletion .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ changelog:
- bug
- title: 🗣️ Translation
labels:
- translation
- translation
17 changes: 7 additions & 10 deletions .github/workflows/broken-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@ jobs:
build_and_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup workspace and build
uses: ./.github/actions/setup-workspace
with:
node-version: 18.x
cache: yarn

- name: Install and build
run: |
yarn install --frozen-lockfile
yarn build
build: 'true'

- name: Link Checker
id: lychee
Expand All @@ -35,4 +32,4 @@ jobs:
with:
title: Link Checker Report
content-filepath: ./lychee/out.md
labels: report, automated issue
labels: report, automated issue
3 changes: 1 addition & 2 deletions .github/workflows/enforce-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ jobs:
- uses: yogevbd/enforce-label-action@2.1.0
with:
REQUIRED_LABELS_ANY: "ci,bug,documentation,duplicate,enhancement,good first issue,help wanted,invalid,question,translation,wontfix,dependencies"
REQUIRED_LABELS_ANY_DESCRIPTION: "Select at least one label ['ci', 'bug','documentation','duplicate','enhancement','good first issue','help wanted','invalid','question','translation','wontfix','dependencies']"

REQUIRED_LABELS_ANY_DESCRIPTION: "Select at least one label ['ci', 'bug','documentation','duplicate','enhancement','good first issue','help wanted','invalid','question','translation','wontfix','dependencies']"
17 changes: 7 additions & 10 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,18 @@ jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 18.x
cache: yarn
- name: Checkout repository
uses: actions/checkout@v4

- name: Install and build
run: |
yarn install --frozen-lockfile
yarn build
- name: Setup workspace and build
uses: ./.github/actions/setup-workspace
with:
build: 'true'

- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_ASTAR_DOCS }}'
channelId: live
projectId: astar-docs
firebaseToolsVersion: 13.35.1
firebaseToolsVersion: 13.35.1
17 changes: 7 additions & 10 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,17 @@ jobs:
if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup workspace and build
uses: ./.github/actions/setup-workspace
with:
node-version: 18.x
cache: yarn
build: 'true'

- name: Install and build
run: |
yarn install --frozen-lockfile
yarn build

- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_ASTAR_DOCS }}'
projectId: astar-docs
firebaseToolsVersion: 13.35.1
firebaseToolsVersion: 13.35.1
2 changes: 1 addition & 1 deletion .github/workflows/md-link-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
- uses: gaurav-nelson/github-action-markdown-link-check@0a51127e9955b855a9bbfa1ff5577f1d1338c9a5 # 1.0.14
with:
use-quiet-mode: 'yes'
config-file: '.github/workflows/mlc_config.json'
config-file: '.github/workflows/mlc_config.json'
2 changes: 1 addition & 1 deletion .github/workflows/monthly-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ jobs:
with:
tag_name: ${{ steps.create_tag.outputs.new_tag }}
release_name: Release ${{ steps.create_tag.outputs.new_tag }}
body: ${{ steps.create_release_note.outputs.changelog }}
body: ${{ steps.create_release_note.outputs.changelog }}
17 changes: 8 additions & 9 deletions .github/workflows/s3-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,19 @@ jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup workspace and build
uses: ./.github/actions/setup-workspace
with:
node-version: 18.x
cache: yarn
build: 'true'

- name: Install and build
run: |
yarn install --frozen-lockfile
yarn build
- uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Deploy app build to S3 bucket
run: aws s3 sync ./build s3://astar-docs --delete
run: aws s3 sync ./build s3://astar-docs --delete
80 changes: 61 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,31 +1,73 @@
# Dependencies
/node_modules
# ------------------------
# ⚙️ Node / Yarn / Docusaurus
# ------------------------

# Production
/build
# Node modules (legacy, if nodeLinker: node-modules)
node_modules/

# Generated files
.docusaurus
.cache-loader
# Docusaurus build output
build/
!docs/build/
.docusaurus/

# Misc
.DS_Store
# Yarn v2+ PnP (Zero-install support)
.yarn/*
!.yarn/cache
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*
.yarnrc.yml

# ------------------------
# 📝 Config / Env files
# ------------------------

.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# ------------------------
# 🛠️ Editor / System
# ------------------------

# VS Code
.vscode/
# JetBrains
.idea/
# Vim / Swap
*.swp
# macOS
.DS_Store
# Windows
Thumbs.db

# ------------------------
# 🧪 Tests / Debug
# ------------------------

npm-debug.log*
yarn-debug.log*
yarn-error.log*

# yarn v2
.yarn/*
.yarnrc.yml
!.yarn/cache # Uncomment for zero-install
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
# .pnp.* # Comment for zero-install
package.json
# ------------------------
# 🧱 TypeScript
# ------------------------

*.tsbuildinfo

# ------------------------
# 📊 Output / Coverage
# ------------------------

coverage/

# ------------------------
# 🔥 Firebase (optional)
# ------------------------

.firebase/
.firebaserc
1 change: 0 additions & 1 deletion .node-version

This file was deleted.

2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.0
22.17.0
Loading