From 10e5ea10c9a2e9ea4066a7ca33ef70c94b7b6569 Mon Sep 17 00:00:00 2001 From: Sam Wronski Date: Fri, 11 Nov 2022 12:13:43 -0800 Subject: [PATCH 01/16] deploy-presentations action --- .github/workflows/deploy-presentations.yml | 66 ++++++++++++++++++++++ generated/README.md | 3 + 2 files changed, 69 insertions(+) create mode 100644 .github/workflows/deploy-presentations.yml create mode 100644 generated/README.md diff --git a/.github/workflows/deploy-presentations.yml b/.github/workflows/deploy-presentations.yml new file mode 100644 index 0000000..bd6cb98 --- /dev/null +++ b/.github/workflows/deploy-presentations.yml @@ -0,0 +1,66 @@ +name: Deploy static content to Pages + +on: + push: + branches: ["add-actions"] + + # 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: + setup: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - run: cd presentations + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 16 + cache: npm + cache-dependency-path: "**/package-lock.json" + - run: npm ci + + build: + needs: setup + runs-on: ubuntu-latest + strategy: + matrix: + presentations: + - "intro-to-github" + - "get-signed-up-with-github" + - "contributions-licensing" + steps: + - run: npm run slidev build ${{ matrix.presentations }}/slides.md --out ../generated/web/${{ matrix.presentations }} + - run: ls ../generated/web/${{ matrix.presentations }} + + # Single deploy job to consolidate matrix above + deploy: + needs: build + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - 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/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. From e20de3d58b6ee50e310bafae17005ed88ffece13 Mon Sep 17 00:00:00 2001 From: Sam Wronski Date: Fri, 11 Nov 2022 17:34:17 -0800 Subject: [PATCH 02/16] Presentations update --- .github/workflows/deploy-presentations.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-presentations.yml b/.github/workflows/deploy-presentations.yml index bd6cb98..74c18fc 100644 --- a/.github/workflows/deploy-presentations.yml +++ b/.github/workflows/deploy-presentations.yml @@ -24,14 +24,15 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - - run: cd presentations - name: Setup Node uses: actions/setup-node@v3 with: node-version: 16 cache: npm cache-dependency-path: "**/package-lock.json" - - run: npm ci + - run: | + cd presentations + npm ci build: needs: setup From a50ab45778921246eebde0a6b2354d6bc7fc74cf Mon Sep 17 00:00:00 2001 From: Sam Wronski Date: Fri, 11 Nov 2022 17:37:01 -0800 Subject: [PATCH 03/16] Ensure using the correct location --- .github/workflows/deploy-presentations.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-presentations.yml b/.github/workflows/deploy-presentations.yml index 74c18fc..3d31fb2 100644 --- a/.github/workflows/deploy-presentations.yml +++ b/.github/workflows/deploy-presentations.yml @@ -44,8 +44,10 @@ jobs: - "get-signed-up-with-github" - "contributions-licensing" steps: - - run: npm run slidev build ${{ matrix.presentations }}/slides.md --out ../generated/web/${{ matrix.presentations }} - - run: ls ../generated/web/${{ matrix.presentations }} + - run: | + cd presentations + npm run slidev build ${{ matrix.presentations }}/slides.md --out ../generated/web/${{ matrix.presentations }} + ls ../generated/web/${{ matrix.presentations }} # Single deploy job to consolidate matrix above deploy: From bae8c31b8bf94eba57f64b15aa98b92bc0a58ddb Mon Sep 17 00:00:00 2001 From: Sam Wronski Date: Fri, 11 Nov 2022 17:40:43 -0800 Subject: [PATCH 04/16] Remove step - rely on matrixing --- .github/workflows/deploy-presentations.yml | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/workflows/deploy-presentations.yml b/.github/workflows/deploy-presentations.yml index 3d31fb2..27779f7 100644 --- a/.github/workflows/deploy-presentations.yml +++ b/.github/workflows/deploy-presentations.yml @@ -19,8 +19,15 @@ concurrency: cancel-in-progress: true jobs: - setup: + build: + needs: setup runs-on: ubuntu-latest + strategy: + matrix: + presentations: + - "intro-to-github" + - "get-signed-up-with-github" + - "contributions-licensing" steps: - name: Checkout uses: actions/checkout@v3 @@ -33,19 +40,6 @@ jobs: - run: | cd presentations npm ci - - build: - needs: setup - runs-on: ubuntu-latest - strategy: - matrix: - presentations: - - "intro-to-github" - - "get-signed-up-with-github" - - "contributions-licensing" - steps: - - run: | - cd presentations npm run slidev build ${{ matrix.presentations }}/slides.md --out ../generated/web/${{ matrix.presentations }} ls ../generated/web/${{ matrix.presentations }} From 15c0172663f33744bfd713bc6964199549aced84 Mon Sep 17 00:00:00 2001 From: Sam Wronski Date: Fri, 11 Nov 2022 17:41:54 -0800 Subject: [PATCH 05/16] Remove dependency config --- .github/workflows/deploy-presentations.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/deploy-presentations.yml b/.github/workflows/deploy-presentations.yml index 27779f7..574436c 100644 --- a/.github/workflows/deploy-presentations.yml +++ b/.github/workflows/deploy-presentations.yml @@ -20,7 +20,6 @@ concurrency: jobs: build: - needs: setup runs-on: ubuntu-latest strategy: matrix: From 565aa4d560750ae4d63e395f6800152b8ec48beb Mon Sep 17 00:00:00 2001 From: Sam Wronski Date: Fri, 11 Nov 2022 17:46:51 -0800 Subject: [PATCH 06/16] Separate install and run --- .github/workflows/deploy-presentations.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy-presentations.yml b/.github/workflows/deploy-presentations.yml index 574436c..ed822a5 100644 --- a/.github/workflows/deploy-presentations.yml +++ b/.github/workflows/deploy-presentations.yml @@ -39,6 +39,7 @@ jobs: - run: | cd presentations npm ci + - run: | npm run slidev build ${{ matrix.presentations }}/slides.md --out ../generated/web/${{ matrix.presentations }} ls ../generated/web/${{ matrix.presentations }} From 686c7e5a048f0f55d54d7c9efdabed67420b9d67 Mon Sep 17 00:00:00 2001 From: Sam Wronski Date: Fri, 11 Nov 2022 17:51:03 -0800 Subject: [PATCH 07/16] add directory --- .github/workflows/deploy-presentations.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy-presentations.yml b/.github/workflows/deploy-presentations.yml index ed822a5..2399f72 100644 --- a/.github/workflows/deploy-presentations.yml +++ b/.github/workflows/deploy-presentations.yml @@ -40,6 +40,7 @@ jobs: cd presentations npm ci - run: | + cd presentations npm run slidev build ${{ matrix.presentations }}/slides.md --out ../generated/web/${{ matrix.presentations }} ls ../generated/web/${{ matrix.presentations }} From bf503ab25d4c0eae37f3093bee063f5a3951e44c Mon Sep 17 00:00:00 2001 From: Sam Wronski Date: Fri, 11 Nov 2022 17:53:46 -0800 Subject: [PATCH 08/16] This does not make sense --- .github/workflows/deploy-presentations.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy-presentations.yml b/.github/workflows/deploy-presentations.yml index 2399f72..8561e50 100644 --- a/.github/workflows/deploy-presentations.yml +++ b/.github/workflows/deploy-presentations.yml @@ -39,6 +39,7 @@ jobs: - run: | cd presentations npm ci + npm install - run: | cd presentations npm run slidev build ${{ matrix.presentations }}/slides.md --out ../generated/web/${{ matrix.presentations }} From 7083d0108c3b19db070ea21eb4d61557cd254477 Mon Sep 17 00:00:00 2001 From: Sam Wronski Date: Fri, 11 Nov 2022 18:44:22 -0800 Subject: [PATCH 09/16] Add command, slidev is broken? --- .github/workflows/deploy-presentations.yml | 5 +---- presentations/package.json | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-presentations.yml b/.github/workflows/deploy-presentations.yml index 8561e50..000833b 100644 --- a/.github/workflows/deploy-presentations.yml +++ b/.github/workflows/deploy-presentations.yml @@ -39,10 +39,7 @@ jobs: - run: | cd presentations npm ci - npm install - - run: | - cd presentations - npm run slidev build ${{ matrix.presentations }}/slides.md --out ../generated/web/${{ matrix.presentations }} + npm run dev -- build ${{ matrix.presentations }}/slides.md --out ../generated/web/${{ matrix.presentations }} ls ../generated/web/${{ matrix.presentations }} # Single deploy job to consolidate matrix above diff --git a/presentations/package.json b/presentations/package.json index 7a4a302..8f71e78 100644 --- a/presentations/package.json +++ b/presentations/package.json @@ -4,6 +4,7 @@ "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" From b65a2762478664fb333f9dcaade1d42b548179ba Mon Sep 17 00:00:00 2001 From: Sam Wronski Date: Mon, 14 Nov 2022 14:16:56 -0800 Subject: [PATCH 10/16] Remove matrix --- .github/workflows/deploy-presentations.yml | 24 +++++++--------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/.github/workflows/deploy-presentations.yml b/.github/workflows/deploy-presentations.yml index 000833b..937385b 100644 --- a/.github/workflows/deploy-presentations.yml +++ b/.github/workflows/deploy-presentations.yml @@ -21,12 +21,9 @@ concurrency: jobs: build: runs-on: ubuntu-latest - strategy: - matrix: - presentations: - - "intro-to-github" - - "get-signed-up-with-github" - - "contributions-licensing" + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} steps: - name: Checkout uses: actions/checkout@v3 @@ -39,17 +36,10 @@ jobs: - run: | cd presentations npm ci - npm run dev -- build ${{ matrix.presentations }}/slides.md --out ../generated/web/${{ matrix.presentations }} - ls ../generated/web/${{ matrix.presentations }} - - # Single deploy job to consolidate matrix above - deploy: - needs: build - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - steps: + npm run dev -- build intro-to-github/slides.md --out ../generated/web/intro-to-github + npm run dev -- build get-signed-up-with-github/slides.md --out ../generated/web/get-signed-up-with-github + npm run dev -- build contributions-licensing/slides.md --out ../generated/web/contributions-licensing + ls ../generated/web - name: Setup Pages uses: actions/configure-pages@v2 - name: Upload artifact From 7762c67dd7ca9a28b27323e9a8e0485625fd4aec Mon Sep 17 00:00:00 2001 From: Sam Wronski Date: Mon, 14 Nov 2022 14:20:25 -0800 Subject: [PATCH 11/16] target main branch --- .github/workflows/deploy-presentations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-presentations.yml b/.github/workflows/deploy-presentations.yml index 937385b..890217b 100644 --- a/.github/workflows/deploy-presentations.yml +++ b/.github/workflows/deploy-presentations.yml @@ -2,7 +2,7 @@ name: Deploy static content to Pages on: push: - branches: ["add-actions"] + branches: ["main"] # Redeploy from actions menu workflow_dispatch: From 44da4f481f80d60d42f109c02ab31a34516067bf Mon Sep 17 00:00:00 2001 From: Sam Wronski Date: Mon, 14 Nov 2022 14:44:09 -0800 Subject: [PATCH 12/16] Use npx --- .github/workflows/deploy-presentations.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-presentations.yml b/.github/workflows/deploy-presentations.yml index 890217b..7b75528 100644 --- a/.github/workflows/deploy-presentations.yml +++ b/.github/workflows/deploy-presentations.yml @@ -36,9 +36,9 @@ jobs: - run: | cd presentations npm ci - npm run dev -- build intro-to-github/slides.md --out ../generated/web/intro-to-github - npm run dev -- build get-signed-up-with-github/slides.md --out ../generated/web/get-signed-up-with-github - npm run dev -- build contributions-licensing/slides.md --out ../generated/web/contributions-licensing + npx slidev build intro-to-github/slides.md --out ../generated/web/intro-to-github + npx slidev build get-signed-up-with-github/slides.md --out ../generated/web/get-signed-up-with-github + npx slidev build contributions-licensing/slides.md --out ../generated/web/contributions-licensing ls ../generated/web - name: Setup Pages uses: actions/configure-pages@v2 From 8e2a7e87b63ef75965ddc7293aa666ebd28064bb Mon Sep 17 00:00:00 2001 From: Sam Wronski Date: Tue, 22 Nov 2022 14:43:39 -0800 Subject: [PATCH 13/16] Include default theme for testing --- presentations/package-lock.json | 1 + presentations/package.json | 1 + 2 files changed, 2 insertions(+) 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 8f71e78..cae1744 100644 --- a/presentations/package.json +++ b/presentations/package.json @@ -1,6 +1,7 @@ { "dependencies": { "@slidev/cli": "^0.36.11", + "@slidev/theme-default": "^0.21.2", "slidev-theme-unicorn": "^1.1.1" }, "scripts": { From 3f82aaa11398c41a57ae1770f15b52fda61cbb62 Mon Sep 17 00:00:00 2001 From: Sam Wronski Date: Tue, 22 Nov 2022 16:25:00 -0800 Subject: [PATCH 14/16] Build an intro --- .github/workflows/deploy-presentations.yml | 4 +--- .gitignore | 1 + presentations/package.json | 3 ++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-presentations.yml b/.github/workflows/deploy-presentations.yml index 7b75528..f93f194 100644 --- a/.github/workflows/deploy-presentations.yml +++ b/.github/workflows/deploy-presentations.yml @@ -36,9 +36,7 @@ jobs: - run: | cd presentations npm ci - npx slidev build intro-to-github/slides.md --out ../generated/web/intro-to-github - npx slidev build get-signed-up-with-github/slides.md --out ../generated/web/get-signed-up-with-github - npx slidev build contributions-licensing/slides.md --out ../generated/web/contributions-licensing + npm run build-intro ls ../generated/web - name: Setup Pages uses: actions/configure-pages@v2 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/presentations/package.json b/presentations/package.json index 246f98a..7e6a7df 100644 --- a/presentations/package.json +++ b/presentations/package.json @@ -11,6 +11,7 @@ "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" } } From 8bb310767c1bd6c325bd576de961a42b8e417fb9 Mon Sep 17 00:00:00 2001 From: Sam Wronski Date: Tue, 22 Nov 2022 16:29:43 -0800 Subject: [PATCH 15/16] Add index file --- generated/web/index.html | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 generated/web/index.html 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 From 26a6f673c2810dde42f4b6df961109a04de3d30c Mon Sep 17 00:00:00 2001 From: Sam Wronski Date: Tue, 22 Nov 2022 16:57:56 -0800 Subject: [PATCH 16/16] Generate PDFs --- .github/workflows/generate-pdf.yml | 51 ++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/generate-pdf.yml 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