Skip to content
Merged
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
13 changes: 9 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,26 @@ name: Fly deploy
on:
workflow_dispatch:

permissions:
contents: read

jobs:
deploy:
name: Deploy app
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Enable corepack
shell: bash
run: corepack enable
- name: Setup Node
uses: actions/setup-node@v6
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version-file: .nvmrc
cache: "yarn"
- uses: actions/setup-python@v6
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
- name: Checkout course material
Expand All @@ -27,7 +32,7 @@ jobs:
pip install --upgrade pip setuptools wheel
pip install -r scripts/python_requirements.txt
python scripts/pull_material.py
- uses: superfly/flyctl-actions/setup-flyctl@master
- uses: superfly/flyctl-actions/setup-flyctl@fc53c09e1bc3be6f54706524e3b82c4f462f77be # 1.5
- run: flyctl deploy --remote-only
--build-arg DATABASE_URL=${{secrets.DATABASE_URL}}
--build-arg NEXT_PUBLIC_PLAUSIBLE_DOMAIN=${{secrets.NEXT_PUBLIC_PLAUSIBLE_DOMAIN}}
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
- "docs/**"
- ".github/workflows/docs-build.yml"

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
Expand All @@ -16,20 +19,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
sparse-checkout: docs
persist-credentials: false
- name: Move docs to root
run: mv docs/* .
- name: Setup Ruby
uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@bec3f19a76460dbe12f60def7d1a77585f07516c # v1.322.0
with:
ruby-version: "3.3"
bundler-cache: true
- name: Build with Jekyll
run: bundle exec jekyll build --strict_front_matter
- name: Upload built site
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: docs-site-pr-${{ github.event.pull_request.number }}
path: _site
Expand Down
24 changes: 13 additions & 11 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ on:
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
Expand All @@ -28,33 +23,40 @@ jobs:
# Build job
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
sparse-checkout: docs
persist-credentials: false
- name: Move docs to root
run: mv docs/* .
- name: Setup Ruby
uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@bec3f19a76460dbe12f60def7d1a77585f07516c # v1.322.0
with:
ruby-version: '3.3' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
- name: Build with Jekyll
# Outputs to the './_site' directory by default
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
run: bundle exec jekyll build --baseurl "${STEPS_PAGES_OUTPUTS_BASE_PATH}"
env:
JEKYLL_ENV: production
STEPS_PAGES_OUTPUTS_BASE_PATH: ${{ steps.pages.outputs.base_path }}
- name: Upload artifact
# Automatically uploads an artifact from the './_site' directory by default
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1

# Deployment job
deploy:
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand All @@ -63,4 +65,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
8 changes: 6 additions & 2 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Quality
on:
pull_request:
branches: [main]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
Expand All @@ -10,12 +12,14 @@ jobs:
name: Format with Prettier
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Enable corepack
shell: bash
run: corepack enable
- name: Use Node.js 22
uses: actions/setup-node@v6
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version-file: .nvmrc
cache: 'yarn'
Expand Down
42 changes: 25 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ env:
MATERIAL_REPO: "UNIVERSE-HPC/course-material"
MANAGER: "yarn"

permissions:
contents: read

jobs:
build-and-test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
Expand All @@ -48,17 +51,19 @@ jobs:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/gutenberg_test
steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Enable corepack
shell: bash
run: corepack enable
- name: Setup Node
uses: actions/setup-node@v6
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version-file: .nvmrc
cache: ${{ env.MANAGER }}
- name: Restore cache
uses: actions/cache@v4
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
.next/cache
Expand Down Expand Up @@ -89,7 +94,7 @@ jobs:
run: ${{ env.MANAGER }} build
# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
uses: mxschmitt/action-tmate@35b54afac29c97fb54faba5b513f8fbd1882f113 # v3.24
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
- name: Run e2e tests
run: ${{ env.MANAGER }} ci:e2e
Expand All @@ -101,19 +106,18 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Enable corepack
shell: bash
run: corepack enable
- name: Setup Node
uses: actions/setup-node@v6
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version-file: .nvmrc
cache: ${{ env.MANAGER }}

- name: Install broken-link-checker
run: npm install -g broken-link-checker

- name: Start the site
run: |
yarn install
Expand All @@ -126,7 +130,7 @@ jobs:
id: blc
run: |
echo "Checking for broken links..."
OUTPUT=$(npx broken-link-checker http://localhost:3000/ -rof \
OUTPUT=$(npx --yes broken-link-checker http://localhost:3000/ -rof \
--exclude "github.com" \
--exclude "discuss.python.org" \
--exclude "intel.com" \
Expand Down Expand Up @@ -182,7 +186,9 @@ jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: docker compose build
run: docker compose -f docker-compose.yml build
- name: docker compose up
Expand All @@ -198,16 +204,18 @@ jobs:
runs-on: ubuntu-latest
needs: build-and-test
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Enable corepack
shell: bash
run: corepack enable
- name: Setup Node
uses: actions/setup-node@v6
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version-file: .nvmrc
cache: "yarn"
- uses: actions/setup-python@v6
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
- name: Checkout course material
Expand All @@ -218,8 +226,8 @@ jobs:
python scripts/pull_material.py
- name: Check course material
shell: bash
run: ls ${{ env.MATERIAL_DIR }}
- uses: superfly/flyctl-actions/setup-flyctl@master
run: ls ${MATERIAL_DIR}
- uses: superfly/flyctl-actions/setup-flyctl@fc53c09e1bc3be6f54706524e3b82c4f462f77be # 1.5
- run: flyctl deploy -a gutenberg-staging --remote-only
--build-arg DATABASE_URL=${{secrets.DATABASE_URL_TEST}}
--build-arg NEXT_PUBLIC_PLAUSIBLE_DOMAIN=${{secrets.NEXT_PUBLIC_PLAUSIBLE_DOMAIN_TEST}}
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: GitHub Actions Security Analysis with zizmor

on:
push:
branches: ["main"]
pull_request:
branches: ["**"]

permissions: {}

jobs:
zizmor:
runs-on: ubuntu-latest
permissions:
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Run zizmor 🌈
uses: zizmorcore/zizmor-action@cc914d7f3750a2d13d75c7f184a1060aa0e9d482 # v0.6.4

# Run without the fancy github stuff to get a list of errors output
- name: Run zizmor 🌈
uses: zizmorcore/zizmor-action@cc914d7f3750a2d13d75c7f184a1060aa0e9d482 # v0.6.4
with:
advanced-security: false
Loading