From 6b5bd7047fd9dfe901d651bc6d693a5508264422 Mon Sep 17 00:00:00 2001 From: Dave Gallant Date: Sun, 5 Sep 2021 23:08:23 -0400 Subject: [PATCH] Add github actions deploy --- .github/workflows/gh-pages.yml | 32 ++++++++++++++++++++++++++++++++ .gitmodules | 2 +- Makefile | 3 +-- public | 2 +- 4 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/gh-pages.yml diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 00000000..6b992ecf --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,32 @@ +name: github pages + +on: + push: + branches: + - main # Set a branch to deploy + pull_request: + +jobs: + deploy: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + with: + submodules: true # Fetch Hugo themes (true OR recursive) + fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod + + - name: Setup Hugo + uses: peaceiris/actions-hugo@v2 + with: + hugo-version: 'latest' + # extended: true + + - name: Build + run: hugo --minify + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + if: github.ref == 'refs/heads/main' + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./public diff --git a/.gitmodules b/.gitmodules index 2220d03c..bf8eec5d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "public"] path = public url = git@github.com:davegallant/davegallant.github.io.git - branch = master + branch = main diff --git a/Makefile b/Makefile index 1aa7007d..89c77584 100644 --- a/Makefile +++ b/Makefile @@ -21,8 +21,7 @@ deploy: git add .; \ msg="rebuilding site $$(date)"; \ git commit -m "$$msg"; \ - git push origin main; \ - cd .. || exit; + git push origin main; ## help: Print this help message help: diff --git a/public b/public index c6d614fc..f51840a4 160000 --- a/public +++ b/public @@ -1 +1 @@ -Subproject commit c6d614fc82e270bcc72f0bee31ab11277bc2bb82 +Subproject commit f51840a46849655a8fa05795d05fe202310995f5