Skip to content

Commit

Permalink
Migrate from Gatsby to Astro (#197)
Browse files Browse the repository at this point in the history
* I... am inevitable

* And I... am Iron Man

* Fix broken README

* Update README.md

* Return back to credit names

* Remove extra profiles

* Migrate FA2019-SP2021

* Migrate FA2021-FA2022

* Migrate SP2023-FA2024

* Fix display timezone

* Fix bad timezone

* Display timezone in meeting

* Deprecate image and assets field

* Fix sidebar and meeting countdown tag

* Auto-close mobile nav

* Improve navbar mobile performance

* Add 404 page

* init events

* split to EventCard

* init publication content

* init publications homepage

* fix pdf assets

* Fix vite copy location

* Lift page routes

* Add back CTA links to navbar

* 404 page fixes

* Add home and join page assets

* Remove events template

* BREAKING CHANGE: Set up monorepo structure, upgrade Astro, switch to content layer, lift content directory, calendar fixes

* Update GitHub Actions for monorepo

* Rename deploy-sigpwny-com.yml to deploy.yml

* Update deploy.yml

* Update workflow node version

* Fix package-lock.json

* Update deploy.yml

* Specify working directory for Cloudflare Pages action

* Fix working directory issues?

* Add test

* Remove test

* FIx markdown rendering, add markdown pages

* refactor _global and init fallctf.com

* create _global/components, _global/utils for site configs, and move BaseHead component

* WIP

* wip GH action

* fix GH action yaml

* seperate content layer export and import

* wip GH action

* wip GH action (switch to inputs)

* wip GH action - add input typing

* wip GH action - fixup input

* wip GH action - fixup secrets

* wip GH action - move fallctf to seperate deployment

* rename secret

* fixup secret

* fixup secret (again)

* secrets must be secret...right

* Fix deployment writing?

* Fix build caching?

* Set workflow level permissions

* Fix fallctf workflow

* Workflow updates

* Move checkout

* Update working directory name?

* Fix action file name

* Fix filename frfr

* Add required shell parameter

* init uiuc.tf (CI workflows broken)

* Fix working-directory key

* Fix uiuc.tf workflow, maybe fix deployments for sigpwny.com

* Fix missing gitHubToken parameter

* Update README.md

* Fix status badge layout

* Fix Link component inserting extra whitespace

* Clean up FAQ

* Rename lib to utils

* Collections are defined in individual sites instead, with schemas being exported

* Deprecate React Link component, improve Astro Link component, improve Meeting time

* Improve workflow path triggers

* wip home page

* create publications page

* Add updated SIGPwny stack

* init fallctf event layout

* init event page

* Add pwny rainbow colors, format stack, fix FAQ

* Hide events from navbar, show temporary page for events

* Fix recursive redirects

* Add meeting schedule disclaimer, clean up

* Temporarily remove links from SIGPwnyStack component

* Hide test meeting

* Fix Event schema, add Card component, add sponsors

* Update sponsors CTA prose

* Publications now uses general Card component

* Use default values in schemas, fix meeting SEO, update publications

* Add /join beginner meetings row

* Clean up

* Fix type error

* Add CSAW

* JavaScript moment

* More JavaScript moments

---------

Co-authored-by: Pete Stenger <[email protected]>
  • Loading branch information
WhiteHoodHacker and reteps authored Aug 25, 2024
1 parent d751158 commit 5b4e0de
Show file tree
Hide file tree
Showing 914 changed files with 35,786 additions and 30,658 deletions.
63 changes: 63 additions & 0 deletions .github/actions/build-astro/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Build Astro site
description: Builds an Astro site with build caching
inputs:
working-directory:
description: Working directory to build site from
required: false
type: string
default: '.'
build-directory:
description: Output directory of built site (from working directory)
required: false
type: string
default: 'dist'
cache-directory:
description: Cache directory (from working directory)
required: false
type: string
default: '.cache'
runs:
using: composite
steps:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: latest
cache: npm
cache-dependency-path: ${{ inputs.working-directory }}/package-lock.json

- name: Restore cached build artifacts and node modules
id: cache-build
uses: actions/cache@v3
env:
cache-name: cache-build-and-modules
with:
path: |
${{ inputs.working-directory }}/.astro
${{ inputs.working-directory }}/${{ inputs.cache-directory }}
${{ inputs.working-directory }}/${{ inputs.build-directory }}
${{ inputs.working-directory }}/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles(format('{0}/**/package-lock.json', inputs.working-directory)) }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-build.outputs.cache-hit != 'true' }}
name: (On cache miss) List the state of node modules
continue-on-error: true
run: npm list
shell: bash
working-directory: ${{ inputs.working-directory }}

- if: ${{ steps.cache-build.outputs.cache-hit != 'true' }}
name: (On cache miss) Install node modules
continue-on-error: true
run: npm ci
shell: bash
working-directory: ${{ inputs.working-directory }}

- name: Build site
run: npm run build
shell: bash
working-directory: ${{ inputs.working-directory }}
45 changes: 45 additions & 0 deletions .github/workflows/deploy-fallctf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI/CD (fallctf.com)
on:
push:
paths:
- '_global/**'
- '!_global/content/**'
- '_global/content/events/**'
- '_global/content/profiles/**'
- '.github/**'
- 'fallctf.com/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CI: true
CI_WORKING_DIR: fallctf.com
CI_BUILD_DIR: dist
CI_CACHE_DIR: .cache
jobs:
deploy:
name: Deploy (fallctf.com)
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- name: Check out repository code
uses: actions/checkout@v3

- name: Build site
uses: ./.github/actions/build-astro
with:
working-directory: ${{ env.CI_WORKING_DIR }}
build-directory: ${{ env.CI_BUILD_DIR }}
cache-directory: ${{ env.CI_CACHE_DIR }}

- name: Deploy to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_PAGES_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ vars.CLOUDFLARE_PROJECT_NAME_FALLCTF }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
workingDirectory: ${{ env.CI_WORKING_DIR }}
directory: ${{ env.CI_BUILD_DIR }}
42 changes: 42 additions & 0 deletions .github/workflows/deploy-sigpwny.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI/CD (sigpwny.com)
on:
push:
paths:
- '_global/**'
- '.github/**'
- 'sigpwny.com/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CI: true
CI_WORKING_DIR: sigpwny.com
CI_BUILD_DIR: dist
CI_CACHE_DIR: .cache
jobs:
deploy:
name: Deploy (sigpwny.com)
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- name: Check out repository code
uses: actions/checkout@v3

- name: Build site
uses: ./.github/actions/build-astro
with:
working-directory: ${{ env.CI_WORKING_DIR }}
build-directory: ${{ env.CI_BUILD_DIR }}
cache-directory: ${{ env.CI_CACHE_DIR }}

- name: Deploy to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_PAGES_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ vars.CLOUDFLARE_PROJECT_NAME_SIGPWNY }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
workingDirectory: ${{ env.CI_WORKING_DIR }}
directory: ${{ env.CI_BUILD_DIR }}
45 changes: 45 additions & 0 deletions .github/workflows/deploy-uiuctf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI/CD (uiuc.tf)
on:
push:
paths:
- '_global/**'
- '!_global/content/**'
- '_global/content/events/**'
- '_global/content/profiles/**'
- '.github/**'
- 'uiuc.tf/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CI: true
CI_WORKING_DIR: uiuc.tf
CI_BUILD_DIR: dist
CI_CACHE_DIR: .cache
jobs:
deploy:
name: Deploy (uiuc.tf)
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- name: Check out repository code
uses: actions/checkout@v3

- name: Build site
uses: ./.github/actions/build-astro
with:
working-directory: ${{ env.CI_WORKING_DIR }}
build-directory: ${{ env.CI_BUILD_DIR }}
cache-directory: ${{ env.CI_CACHE_DIR }}

- name: Deploy to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_PAGES_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ vars.CLOUDFLARE_PROJECT_NAME_UIUCTF }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
workingDirectory: ${{ env.CI_WORKING_DIR }}
directory: ${{ env.CI_BUILD_DIR }}
65 changes: 0 additions & 65 deletions .github/workflows/deploy.yml

This file was deleted.

16 changes: 8 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
node_modules/
.cache/
public
src/gatsby-types.d.ts
.DS_store
_site/
.vscode/
.prettierrc
# macOS-specific files
.DS_Store

# jetbrains setting folder
.idea/

# vscode setting folder
.vscode/
Loading

0 comments on commit 5b4e0de

Please sign in to comment.