Skip to content

Add GitHub Actions and Autogenerate Presentations Work #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from
Draft
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
50 changes: 50 additions & 0 deletions .github/workflows/deploy-presentations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Deploy static content to Pages

on:
push:
branches: ["main"]

# Redeploy from actions menu
workflow_dispatch:

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

# This automatically cancels an in-progress deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
cache-dependency-path: "**/package-lock.json"
- run: |
cd presentations
npm ci
npm run build-intro
ls ../generated/web
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload entire repository
path: './generated/web'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
51 changes: 51 additions & 0 deletions .github/workflows/generate-pdf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Generate Presentation PDFs

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
paths:
- "./presentations/*"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# If a job to generate PDFs is already running - cancel it
concurrency:
group: "pdfs"
cancel-in-progress: true

jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
cache-dependency-path: "**/package-lock.json"
- run: |
cd presentations
npm ci
npm run pdf-intro
ls ../generated/presentations
- name: Create Pull Request
uses: runewake2/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update Presentation PDF
committer: GitHub <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
branch: automated-presentation-update-patch
delete-branch: true
title: '[Automated] Update Presentation PDFs'
labels: "automation"
body: |
Update presentation PDFs

Auto-generated by [create-pull-request][1]
[1]: https://github.com/peter-evans/create-pull-request
draft: false
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
dist
.DS_Store
generated/**
3 changes: 3 additions & 0 deletions generated/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Generated

> These files are generated by actions, manual changes may be overwritten.
8 changes: 8 additions & 0 deletions generated/web/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<html>
<head>

</head>
<body>
<h1>Hello World</h1>
</body>
</html>
1 change: 1 addition & 0 deletions presentations/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion presentations/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
{
"dependencies": {
"@slidev/cli": "^0.36.11",
"@slidev/theme-default": "^0.21.2",
"slidev-theme-unicorn": "^1.1.1"
},
"scripts": {
"dev": "slidev",
"intro": "cd intro-to-github && slidev --open",
"licensing": "cd contributions-licensing && slidev --open",
"signup": "cd get-signed-up-with-github && slidev --open",
"welcome": "cd welcome && slidev --open",
"wrap1": "cd day-1-wrap && slidev --open",
"wrap2": "cd day-2-wrap && slidev --open"
"wrap2": "cd day-2-wrap && slidev --open",
"build-intro": "cd intro-to-github && slidev build slides.md --out ../../generated/web/intro-to-github"
}
}