diff --git a/.github/workflows/deploy-presentations.yml b/.github/workflows/deploy-presentations.yml new file mode 100644 index 0000000..f93f194 --- /dev/null +++ b/.github/workflows/deploy-presentations.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/generate-pdf.yml b/.github/workflows/generate-pdf.yml new file mode 100644 index 0000000..475b329 --- /dev/null +++ b/.github/workflows/generate-pdf.yml @@ -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 + 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 diff --git a/.gitignore b/.gitignore index 0ca39c0..adc7521 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules dist .DS_Store +generated/** \ No newline at end of file diff --git a/generated/README.md b/generated/README.md new file mode 100644 index 0000000..92e0f45 --- /dev/null +++ b/generated/README.md @@ -0,0 +1,3 @@ +# Generated + +> These files are generated by actions, manual changes may be overwritten. diff --git a/generated/web/index.html b/generated/web/index.html new file mode 100644 index 0000000..a37a5c3 --- /dev/null +++ b/generated/web/index.html @@ -0,0 +1,8 @@ + + + + + +

Hello World

+ + \ No newline at end of file diff --git a/presentations/package-lock.json b/presentations/package-lock.json index 4ed249e..f718f05 100644 --- a/presentations/package-lock.json +++ b/presentations/package-lock.json @@ -6,6 +6,7 @@ "": { "dependencies": { "@slidev/cli": "^0.36.11", + "@slidev/theme-default": "^0.21.2", "slidev-theme-unicorn": "^1.1.1" } }, diff --git a/presentations/package.json b/presentations/package.json index 2c1106a..7e6a7df 100644 --- a/presentations/package.json +++ b/presentations/package.json @@ -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" } }