generated from block/oss-project-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
5,617 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
name: Build and deploy projects-dashboard | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
paths: | ||
- "projects-dashboard/**" | ||
- ".github/workflows/projects-dashboard.yml" | ||
pull_request: | ||
branches: [main] | ||
paths: | ||
- "projects-dashboard/**" | ||
- ".github/workflows/projects-dashboard.yml" | ||
workflow_dispatch: | ||
|
||
# Allow this job to clone the repo and write comments | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
path: ${{ steps.get-target-folder.outputs.path }} | ||
steps: | ||
- name: Checkout your repository using git | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get target folder | ||
id: get-target-folder | ||
env: | ||
GITHUB_HEAD_REF: ${{ github.head_ref }} | ||
GITHUB_REF_NAME: ${{ github.ref_name }} | ||
run: | | ||
if [ "$GITHUB_HEAD_REF" != "" ]; then | ||
# This is a pull request | ||
BRANCH=$GITHUB_HEAD_REF | ||
else | ||
# This is a push to a branch | ||
BRANCH=$GITHUB_REF_NAME | ||
fi | ||
TARGET_PATH=projects-dashboard | ||
if [ "$BRANCH" != "main" ]; then | ||
# sanitize branch name | ||
BRANCH=$(echo "$BRANCH" | sed 's/[^a-zA-Z0-9-]/_/g') | ||
TARGET_PATH=projects-dashboard-preview-$BRANCH | ||
fi | ||
echo "path=$TARGET_PATH" >> $GITHUB_OUTPUT | ||
# replace basepath in astro.config.mjs using $PATH | ||
sed -i "s|ospo/projects-dashboard|ospo/${TARGET_PATH}|g" projects-dashboard/astro.config.mjs | ||
cat projects-dashboard/astro.config.mjs | ||
- name: Prepare preview path | ||
if: github.event_name == 'pull_request' | ||
run: | | ||
npm install -g pnpm | ||
- name: Install, build, and upload your site | ||
uses: withastro/action@v3 | ||
with: | ||
path: ./projects-dashboard | ||
node-version: 20 | ||
package-manager: pnpm@9 | ||
|
||
deploy: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout your repository using git | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download Artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: github-pages | ||
path: projects-dashboard-site | ||
|
||
- name: Unzip site artifact | ||
run: | | ||
cd ./projects-dashboard-site | ||
tar -xvf artifact.tar . | ||
rm artifact.tar | ||
cd .. | ||
ls -R ./projects-dashboard-site | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
branch: gh-pages | ||
folder: projects-dashboard-site | ||
target-folder: ${{ needs.build.outputs.path }} | ||
|
||
# Add a comment to the PR with the link to the deployed site | ||
- name: Add preview comment to PR | ||
if: github.event_name == 'pull_request' | ||
uses: thollander/actions-comment-pull-request@v2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
comment_tag: preview-deploy | ||
message: | | ||
Site preview deployed to: https://block-open-source.github.io/ospo/${{ needs.build.outputs.path }} | ||
_(execution **[#${{ github.run_id }}](https://github.com/block-open-source/ospo/actions/runs/${{ github.run_id }})** / attempt **${{ github.run_attempt }}**)_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# build output | ||
dist/ | ||
# generated types | ||
.astro/ | ||
|
||
# dependencies | ||
node_modules/ | ||
|
||
# logs | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
|
||
|
||
# environment variables | ||
.env | ||
.env.production | ||
|
||
# macOS-specific files | ||
.DS_Store | ||
|
||
# jetbrains setting folder | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"recommendations": ["astro-build.astro-vscode", "unifiedjs.vscode-mdx"], | ||
"unwantedRecommendations": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"command": "./node_modules/.bin/astro dev", | ||
"name": "Development server", | ||
"request": "launch", | ||
"type": "node-terminal" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Block Open Source Projects Dashboard | ||
|
||
It's a static generated dashboard to list our maintained open source projects and their health status. | ||
|
||
Visit the [live dashboard](https://block-open-source.github.io/ospo/projects-dashboard/). | ||
|
||
## Ready to open source your project? | ||
|
||
Add your project to the `src/content/projects` directory. | ||
|
||
TODO: add description of each field in the config file. For now use one of the existing projects as an example: | ||
|
||
- [example-java-kotlin-maven-multimodule](./src/content/project/block-open-source_example-java-kotlin-maven-multimodule.md) | ||
- [tbdex-rs](./src/content/project/TBD54566975_tbdex-rust.md) | ||
- [web5-js](./src/content/project/TBD54566975_web5-js.md) | ||
|
||
## Development | ||
|
||
Requirements: Node.js 20+ and pnpm | ||
|
||
```sh | ||
pnpm i | ||
pnpm dev | ||
``` | ||
|
||
And to preview the built version that is going to be deployed: | ||
|
||
```sh | ||
pnpm build | ||
pnpm preview | ||
``` | ||
|
||
## Deployment | ||
|
||
This project is deployed automatically when a change is merged into the `main` branch. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// @ts-check | ||
import { defineConfig } from "astro/config"; | ||
import mdx from "@astrojs/mdx"; | ||
|
||
import sitemap from "@astrojs/sitemap"; | ||
|
||
// https://astro.build/config | ||
export default defineConfig({ | ||
site: "https://block-open-source.github.io", | ||
base: "ospo/projects-dashboard", | ||
integrations: [mdx(), sitemap()], | ||
build: { | ||
assets: "generated-assets", | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "former-fusion", | ||
"type": "module", | ||
"version": "0.0.1", | ||
"scripts": { | ||
"dev": "astro dev", | ||
"start": "astro dev", | ||
"build": "astro check && astro build", | ||
"preview": "astro preview", | ||
"astro": "astro" | ||
}, | ||
"dependencies": { | ||
"@astrojs/mdx": "^3.1.7", | ||
"@astrojs/rss": "^4.0.7", | ||
"@astrojs/sitemap": "^3.1.6", | ||
"astro": "^4.15.10", | ||
"@astrojs/check": "^0.9.3", | ||
"typescript": "^5.6.2" | ||
} | ||
} |
Oops, something went wrong.