Skip to content

Update Meeting “fa2024/general/2024-12-05/index” #465

Update Meeting “fa2024/general/2024-12-05/index”

Update Meeting “fa2024/general/2024-12-05/index” #465

name: CI/CD (sigpwny.com)
on:
push:
paths:
- '_global/**'
- '.github/**'
- '!.github/workflows/scheduled-pings.yml'
- 'sigpwny.com/**'
- 'guides'
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@v4
with:
submodules: true
fetch-depth: 0
- name: Build pwnyctf mdbook
uses: ./.github/actions/build-mdbook
with:
book-directory: pwnyctf
- 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
if: github.actor != 'dependabot[bot]'
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 }}
- name: (On main) Sync Discord events
if: github.ref_name == github.event.repository.default_branch
# https://github.com/nodejs/node/issues/50993
run: touch .env && npm run sync-discord
shell: bash
working-directory: ${{ env.CI_WORKING_DIR }}
env:
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
DISCORD_SERVER_ID: ${{ secrets.DISCORD_SERVER_ID }}
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: ${{ env.CI_WORKING_DIR }}/${{ env.CI_BUILD_DIR }}
schedule-notify:
name: Schedule notifications (sigpwny.com)
if: github.ref_name == github.event.repository.default_branch
needs: deploy
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
token: ${{ secrets.WORKFLOW_PAT }}
submodules: true
fetch-depth: 0
- name: Initialize Astro and dependencies
uses: ./.github/actions/build-astro
with:
working-directory: ${{ env.CI_WORKING_DIR }}
build-directory: ${{ env.CI_BUILD_DIR }}
cache-directory: ${{ env.CI_CACHE_DIR }}
skip-build: true
- name: Schedule Discord pings
run: npm run schedule-discord-ping
shell: bash
working-directory: ${{ env.CI_WORKING_DIR }}
- name: Save scheduled Discord pings
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: update workflow schedule"
file_pattern: "*.yml"
kaltura-upload:
name: Upload to YouTube from Kaltura
if: github.ref_name == github.event.repository.default_branch
needs: deploy
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
token: ${{ secrets.WORKFLOW_PAT }}
submodules: true
fetch-depth: 0
- name: Initialize Astro and dependencies
uses: ./.github/actions/build-astro
with:
working-directory: ${{ env.CI_WORKING_DIR }}
build-directory: ${{ env.CI_BUILD_DIR }}
cache-directory: ${{ env.CI_CACHE_DIR }}
skip-build: true
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: pip install -r src/scripts/requirements.txt
working-directory: ${{ env.CI_WORKING_DIR }}
- name: Run Kaltura
run: python3 kaltura2youtube.py
shell: bash
working-directory: ${{ env.CI_WORKING_DIR }}/src/scripts
env:
KALTURA_USERNAME: ${{ secrets.KALTURA_USERNAME }}
KALTURA_PASSWORD: ${{ secrets.KALTURA_PASSWORD }}
YOUTUBE_OAUTH_CREDS: ${{ secrets.YOUTUBE_OAUTH_CREDS }}
- name: Save scheduled Discord pings
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: update workflow schedule"
file_pattern: "*.yml"