diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml new file mode 100644 index 0000000..55adb1b --- /dev/null +++ b/.github/workflows/deploy-pages.yml @@ -0,0 +1,38 @@ +name: "Deploy to GitHub pages" + +on: + push: + branches: + - main + - github-pages + + workflow_dispatch: + +permissions: + contents: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Echo version + run: | + version=$(git rev-parse HEAD) + echo "Replacing version number in *.html with $version" + - name: Replace version + run: | + mkdir production + cp -R -v *.html css js production + version=$(git rev-parse HEAD) + echo "Replacing version number in *.html with $version" + perl -pi -e 's/{VERSION}/'$version'/g' production/*.html + - name: Deploy to GitHub Pages + id: deployment + uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: ./production diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..dca74eb --- /dev/null +++ b/docs/README.md @@ -0,0 +1 @@ +Here comes the production code. diff --git a/tutorial.html b/index.html similarity index 98% rename from tutorial.html rename to index.html index 213e2d7..98a81ed 100644 --- a/tutorial.html +++ b/index.html @@ -58,7 +58,7 @@