From 3992e805dc544d9dc65de04f648bef1ef3eeff62 Mon Sep 17 00:00:00 2001 From: Nikos Kontakis Date: Fri, 22 Dec 2023 12:15:15 +0200 Subject: [PATCH] Make pba-content public (#878) * add gh-pages * Alter package json * Add publish script for pba-content * remove scripts that deploy to ipfs --- .github/workflows/ci.yml | 39 ------ .github/workflows/deploy.yml | 23 ++++ package.json | 9 +- yarn.lock | 228 ++++++++++++++++++++++++++++++++++- 4 files changed, 252 insertions(+), 47 deletions(-) delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index d007021ef..000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,39 +0,0 @@ -# Note gh-pages is *not* the host presently, fleek is. -# Fleek renders files when a push to `gh-pages` by this CI happens. - -name: Build and deploy to `gh-pages` -on: - push: - branches: - - main - -jobs: - gh-pages: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Yarn - uses: bahmutov/npm-install@HEAD - with: - working-directory: . - - name: Build internal use static slides - run: | - yarn build-internal-static-slides - - name: Deploy `internal-static-slides` branch https://do-not-share-pba-internal.on.fleek.co/ - uses: crazy-max/ghaction-github-pages@v2 - with: - target_branch: internal-static-slides - build_dir: build - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Build student use static slides - run: | - yarn build-student-static-slides - - name: Deploy `student-static-slides` branch to https://polkadot-blockchain-academy.on.fleek.co/ - uses: crazy-max/ghaction-github-pages@v2 - with: - target_branch: student-static-slides - build_dir: build - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 000000000..b0110b8c6 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,23 @@ +name: GitHub Pages Publish + +on: + push: + branches: [main] + +jobs: + gh-deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 18 + registry-url: https://registry.npmjs.org + - run: yarn install + - name: Build + working-directory: "." + run: yarn build:pages + - name: Deploy + uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: build diff --git a/package.json b/package.json index 6d2ff3ae2..e66fa7c77 100644 --- a/package.json +++ b/package.json @@ -3,14 +3,10 @@ "version": "0.1.0", "description": "Polkadot Blockchain Academy", "scripts": { - "start": "reveal-md ./ --watch --absolute-url http://localhost:1948", - "s": "yarn start", - "dev": "yarn start", + "dev": "reveal-md ./ --watch --absolute-url http://localhost:1948", "help-rmd": "reveal-md --help", "build": "rm -rf build && reveal-md ./ --static build", - "build-internal-static-slides": "rm -rf build && reveal-md ./ --static build --absolute-url https://do-not-share-pba-internal.on.fleek.co/", - "build-slides-for-site-book": "rm -rf ../src/slides && reveal-md ./ --static ../src/slides --absolute-url https://polkadot-blockchain-academy.github.io/pba-site/", - "build-student-static-slides": "rm -rf build && reveal-md ./ --static build --absolute-url https://polkadot-blockchain-academy.on.fleek.co/ --glob 'syllabus/[0-8]*/**/*[Ss]lides.md'", + "deploy": "yarn build && gh-pages -d build", "serve": "http-server ./build -p 1949 -s & echo server started http://localhost:1949", "fmt": "prettier --config .prettierrc.js --write '**/*.md'", "fmt-book": "prettier --config .prettierrc.js --write '../src/**/*.md'", @@ -21,6 +17,7 @@ "reveal-md": "^5.5.2" }, "devDependencies": { + "gh-pages": "^6.1.0", "http-server": "^14.1.1", "markdown-link-check": "^3.10.3", "prettier": "^2.6.2" diff --git a/yarn.lock b/yarn.lock index 051431683..2b0dc2471 100644 --- a/yarn.lock +++ b/yarn.lock @@ -201,6 +201,22 @@ __metadata: languageName: node linkType: hard +"array-union@npm:^1.0.1": + version: 1.0.2 + resolution: "array-union@npm:1.0.2" + dependencies: + array-uniq: ^1.0.1 + checksum: 82cec6421b6e6766556c484835a6d476a873f1b71cace5ab2b4f1b15b1e3162dc4da0d16f7a2b04d4aec18146c6638fe8f661340b31ba8e469fd811a1b45dc8d + languageName: node + linkType: hard + +"array-uniq@npm:^1.0.1": + version: 1.0.3 + resolution: "array-uniq@npm:1.0.3" + checksum: 1625f06b093d8bf279b81adfec6e72951c0857d65b5e3f65f053fffe9f9dd61c2fc52cff57e38a4700817e7e3f01a4faa433d505ea9e33cdae4514c334e0bf9e + languageName: node + linkType: hard + "async-limiter@npm:~1.0.0": version: 1.0.1 resolution: "async-limiter@npm:1.0.1" @@ -517,6 +533,13 @@ __metadata: languageName: node linkType: hard +"commander@npm:^11.0.0": + version: 11.1.0 + resolution: "commander@npm:11.1.0" + checksum: fd1a8557c6b5b622c89ecdfde703242ab7db3b628ea5d1755784c79b8e7cb0d74d65b4a262289b533359cd58e1bfc0bf50245dfbcd2954682a6f367c828b79ef + languageName: node + linkType: hard + "commander@npm:^6.2.0": version: 6.2.1 resolution: "commander@npm:6.2.1" @@ -524,6 +547,13 @@ __metadata: languageName: node linkType: hard +"commondir@npm:^1.0.1": + version: 1.0.1 + resolution: "commondir@npm:1.0.1" + checksum: 59715f2fc456a73f68826285718503340b9f0dd89bfffc42749906c5cf3d4277ef11ef1cca0350d0e79204f00f1f6d83851ececc9095dc88512a697ac0b9bdcb + languageName: node + linkType: hard + "concat-map@npm:0.0.1": version: 0.0.1 resolution: "concat-map@npm:0.0.1" @@ -792,6 +822,13 @@ __metadata: languageName: node linkType: hard +"email-addresses@npm:^5.0.0": + version: 5.0.0 + resolution: "email-addresses@npm:5.0.0" + checksum: e58a510e9caf105313025e1c81488d5391c6404f0bbd7874e8e36a4c14d1ced02ff271748146c13edfa3bd9ce9b25f1194f5369971d77087325f37ab193129bb + languageName: node + linkType: hard + "emoji-regex@npm:^8.0.0": version: 8.0.0 resolution: "emoji-regex@npm:8.0.0" @@ -882,6 +919,13 @@ __metadata: languageName: node linkType: hard +"escape-string-regexp@npm:^1.0.2": + version: 1.0.5 + resolution: "escape-string-regexp@npm:1.0.5" + checksum: 6092fda75c63b110c706b6a9bfde8a612ad595b628f0bd2147eea1d3406723020810e591effc7db1da91d80a71a737a313567c5abb3813e8d9c71f4aa595b410 + languageName: node + linkType: hard + "esprima@npm:^4.0.0": version: 4.0.1 resolution: "esprima@npm:4.0.1" @@ -975,6 +1019,24 @@ __metadata: languageName: node linkType: hard +"filename-reserved-regex@npm:^2.0.0": + version: 2.0.0 + resolution: "filename-reserved-regex@npm:2.0.0" + checksum: 323a0020fd7f243238ffccab9d728cbc5f3a13c84b2c10e01efb09b8324561d7a51776be76f36603c734d4f69145c39a5d12492bf6142a28b50d7f90bd6190bc + languageName: node + linkType: hard + +"filenamify@npm:^4.3.0": + version: 4.3.0 + resolution: "filenamify@npm:4.3.0" + dependencies: + filename-reserved-regex: ^2.0.0 + strip-outer: ^1.0.1 + trim-repeated: ^1.0.0 + checksum: 5b71a7ff8e958c8621957e6fbf7872024126d3b5da50f59b1634af3343ba1a69d4cc15cfe4ca4bbfa7c959ad4d98614ee51e6f1d9fa7326eef8ceda2da8cd74e + languageName: node + linkType: hard + "fill-range@npm:^7.0.1": version: 7.0.1 resolution: "fill-range@npm:7.0.1" @@ -999,6 +1061,27 @@ __metadata: languageName: node linkType: hard +"find-cache-dir@npm:^3.3.1": + version: 3.3.2 + resolution: "find-cache-dir@npm:3.3.2" + dependencies: + commondir: ^1.0.1 + make-dir: ^3.0.2 + pkg-dir: ^4.1.0 + checksum: 1e61c2e64f5c0b1c535bd85939ae73b0e5773142713273818cc0b393ee3555fb0fd44e1a5b161b8b6c3e03e98c2fcc9c227d784850a13a90a8ab576869576817 + languageName: node + linkType: hard + +"find-up@npm:^4.0.0": + version: 4.1.0 + resolution: "find-up@npm:4.1.0" + dependencies: + locate-path: ^5.0.0 + path-exists: ^4.0.0 + checksum: 4c172680e8f8c1f78839486e14a43ef82e9decd0e74145f40707cc42e7420506d5ec92d9a11c22bd2c48fb0c384ea05dd30e10dd152fefeec6f2f75282a8b844 + languageName: node + linkType: hard + "follow-redirects@npm:^1.0.0": version: 1.15.3 resolution: "follow-redirects@npm:1.15.3" @@ -1044,6 +1127,17 @@ __metadata: languageName: node linkType: hard +"fs-extra@npm:^11.1.1": + version: 11.2.0 + resolution: "fs-extra@npm:11.2.0" + dependencies: + graceful-fs: ^4.2.0 + jsonfile: ^6.0.1 + universalify: ^2.0.0 + checksum: b12e42fa40ba47104202f57b8480dd098aa931c2724565e5e70779ab87605665594e76ee5fb00545f772ab9ace167fe06d2ab009c416dc8c842c5ae6df7aa7e8 + languageName: node + linkType: hard + "fs-minipass@npm:^2.0.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0" @@ -1125,6 +1219,24 @@ __metadata: languageName: node linkType: hard +"gh-pages@npm:^6.1.0": + version: 6.1.0 + resolution: "gh-pages@npm:6.1.0" + dependencies: + async: ^3.2.4 + commander: ^11.0.0 + email-addresses: ^5.0.0 + filenamify: ^4.3.0 + find-cache-dir: ^3.3.1 + fs-extra: ^11.1.1 + globby: ^6.1.0 + bin: + gh-pages: bin/gh-pages.js + gh-pages-clean: bin/gh-pages-clean.js + checksum: aa8a836869f49203b9fe6f7b2e5b02fbe38349036f5f0a8b0e3d0a6bfae81d02a3212971ac58e04948f9830215a0f94a651b266e1cf83ebb8f1b86a22835f72d + languageName: node + linkType: hard + "glob-parent@npm:~5.1.2": version: 5.1.2 resolution: "glob-parent@npm:5.1.2" @@ -1162,7 +1274,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:^7.1.3": +"glob@npm:^7.0.3, glob@npm:^7.1.3": version: 7.2.3 resolution: "glob@npm:7.2.3" dependencies: @@ -1185,6 +1297,19 @@ __metadata: languageName: node linkType: hard +"globby@npm:^6.1.0": + version: 6.1.0 + resolution: "globby@npm:6.1.0" + dependencies: + array-union: ^1.0.1 + glob: ^7.0.3 + object-assign: ^4.0.1 + pify: ^2.0.0 + pinkie-promise: ^2.0.0 + checksum: 18109d6b9d55643d2b98b59c3cfae7073ccfe39829632f353d516cc124d836c2ddebe48a23f04af63d66a621b6d86dd4cbd7e6af906f2458a7fe510ffc4bd424 + languageName: node + linkType: hard + "gopd@npm:^1.0.1": version: 1.0.1 resolution: "gopd@npm:1.0.1" @@ -1742,6 +1867,15 @@ __metadata: languageName: node linkType: hard +"locate-path@npm:^5.0.0": + version: 5.0.0 + resolution: "locate-path@npm:5.0.0" + dependencies: + p-locate: ^4.1.0 + checksum: 83e51725e67517287d73e1ded92b28602e3ae5580b301fe54bfb76c0c723e3f285b19252e375712316774cf52006cb236aed5704692c32db0d5d089b69696e30 + languageName: node + linkType: hard + "lodash@npm:4.17.21, lodash@npm:^4.17.14, lodash@npm:^4.17.21": version: 4.17.21 resolution: "lodash@npm:4.17.21" @@ -1779,7 +1913,7 @@ __metadata: languageName: node linkType: hard -"make-dir@npm:^3.0.0": +"make-dir@npm:^3.0.0, make-dir@npm:^3.0.2": version: 3.1.0 resolution: "make-dir@npm:3.1.0" dependencies: @@ -2154,6 +2288,13 @@ __metadata: languageName: node linkType: hard +"object-assign@npm:^4.0.1": + version: 4.1.1 + resolution: "object-assign@npm:4.1.1" + checksum: fcc6e4ea8c7fe48abfbb552578b1c53e0d194086e2e6bbbf59e0a536381a292f39943c6e9628af05b5528aa5e3318bb30d6b2e53cadaf5b8fe9e12c4b69af23f + languageName: node + linkType: hard + "object-inspect@npm:^1.9.0": version: 1.13.1 resolution: "object-inspect@npm:1.13.1" @@ -2213,6 +2354,24 @@ __metadata: languageName: node linkType: hard +"p-limit@npm:^2.2.0": + version: 2.3.0 + resolution: "p-limit@npm:2.3.0" + dependencies: + p-try: ^2.0.0 + checksum: 84ff17f1a38126c3314e91ecfe56aecbf36430940e2873dadaa773ffe072dc23b7af8e46d4b6485d302a11673fe94c6b67ca2cfbb60c989848b02100d0594ac1 + languageName: node + linkType: hard + +"p-locate@npm:^4.1.0": + version: 4.1.0 + resolution: "p-locate@npm:4.1.0" + dependencies: + p-limit: ^2.2.0 + checksum: 513bd14a455f5da4ebfcb819ef706c54adb09097703de6aeaa5d26fe5ea16df92b48d1ac45e01e3944ce1e6aa2a66f7f8894742b8c9d6e276e16cd2049a2b870 + languageName: node + linkType: hard + "p-map@npm:^4.0.0": version: 4.0.0 resolution: "p-map@npm:4.0.0" @@ -2222,6 +2381,13 @@ __metadata: languageName: node linkType: hard +"p-try@npm:^2.0.0": + version: 2.2.0 + resolution: "p-try@npm:2.2.0" + checksum: f8a8e9a7693659383f06aec604ad5ead237c7a261c18048a6e1b5b85a5f8a067e469aa24f5bc009b991ea3b058a87f5065ef4176793a200d4917349881216cae + languageName: node + linkType: hard + "package-json@npm:^6.3.0": version: 6.5.0 resolution: "package-json@npm:6.5.0" @@ -2260,6 +2426,13 @@ __metadata: languageName: node linkType: hard +"path-exists@npm:^4.0.0": + version: 4.0.0 + resolution: "path-exists@npm:4.0.0" + checksum: 505807199dfb7c50737b057dd8d351b82c033029ab94cb10a657609e00c1bc53b951cfdbccab8de04c5584d5eff31128ce6afd3db79281874a5ef2adbba55ed1 + languageName: node + linkType: hard + "path-is-absolute@npm:^1.0.0": version: 1.0.1 resolution: "path-is-absolute@npm:1.0.1" @@ -2305,10 +2478,43 @@ __metadata: languageName: node linkType: hard +"pify@npm:^2.0.0": + version: 2.3.0 + resolution: "pify@npm:2.3.0" + checksum: 9503aaeaf4577acc58642ad1d25c45c6d90288596238fb68f82811c08104c800e5a7870398e9f015d82b44ecbcbef3dc3d4251a1cbb582f6e5959fe09884b2ba + languageName: node + linkType: hard + +"pinkie-promise@npm:^2.0.0": + version: 2.0.1 + resolution: "pinkie-promise@npm:2.0.1" + dependencies: + pinkie: ^2.0.0 + checksum: b53a4a2e73bf56b6f421eef711e7bdcb693d6abb474d57c5c413b809f654ba5ee750c6a96dd7225052d4b96c4d053cdcb34b708a86fceed4663303abee52fcca + languageName: node + linkType: hard + +"pinkie@npm:^2.0.0": + version: 2.0.4 + resolution: "pinkie@npm:2.0.4" + checksum: b12b10afea1177595aab036fc220785488f67b4b0fc49e7a27979472592e971614fa1c728e63ad3e7eb748b4ec3c3dbd780819331dad6f7d635c77c10537b9db + languageName: node + linkType: hard + +"pkg-dir@npm:^4.1.0": + version: 4.2.0 + resolution: "pkg-dir@npm:4.2.0" + dependencies: + find-up: ^4.0.0 + checksum: 9863e3f35132bf99ae1636d31ff1e1e3501251d480336edb1c211133c8d58906bed80f154a1d723652df1fda91e01c7442c2eeaf9dc83157c7ae89087e43c8d6 + languageName: node + linkType: hard + "polkadot-blockchain-academy@workspace:.": version: 0.0.0-use.local resolution: "polkadot-blockchain-academy@workspace:." dependencies: + gh-pages: ^6.1.0 http-server: ^14.1.1 markdown-link-check: ^3.10.3 prettier: ^2.6.2 @@ -2880,6 +3086,15 @@ __metadata: languageName: node linkType: hard +"strip-outer@npm:^1.0.1": + version: 1.0.1 + resolution: "strip-outer@npm:1.0.1" + dependencies: + escape-string-regexp: ^1.0.2 + checksum: f8d65d33ca2b49aabc66bb41d689dda7b8b9959d320e3a40a2ef4d7079ff2f67ffb72db43f179f48dbf9495c2e33742863feab7a584d180fa62505439162c191 + languageName: node + linkType: hard + "supports-color@npm:^7.1.0": version: 7.2.0 resolution: "supports-color@npm:7.2.0" @@ -2926,6 +3141,15 @@ __metadata: languageName: node linkType: hard +"trim-repeated@npm:^1.0.0": + version: 1.0.0 + resolution: "trim-repeated@npm:1.0.0" + dependencies: + escape-string-regexp: ^1.0.2 + checksum: e25c235305b82c43f1d64a67a71226c406b00281755e4c2c4f3b1d0b09c687a535dd3c4483327f949f28bb89dc400a0bc5e5b749054f4b99f49ebfe48ba36496 + languageName: node + linkType: hard + "try-require@npm:1.2.1": version: 1.2.1 resolution: "try-require@npm:1.2.1"