]> Untitled Git - bitcoindevkit.org/commitdiff
Automatically publish to GitHub Pages
authorAlekos Filini <alekos.filini@gmail.com>
Thu, 3 Dec 2020 13:18:33 +0000 (14:18 +0100)
committerAlekos Filini <alekos.filini@gmail.com>
Thu, 3 Dec 2020 14:35:41 +0000 (15:35 +0100)
.github/workflows/publish.yml [new file with mode: 0644]

diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
new file mode 100644 (file)
index 0000000..425285c
--- /dev/null
@@ -0,0 +1,27 @@
+name: publish
+on:
+  push:
+    branches:
+    - master
+
+jobs:
+  build:
+    name: Build and publish
+    runs-on: ubuntu-latest
+    env:
+      HUGO_VERSION: 0.79.0
+    if: github.ref == 'refs/heads/master'
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v2
+        with:
+          fetch-depth: '0'
+          submodules: 'recursive'
+      - name: Configure git
+        run: git config user.email "github-actions@github.com" && git config user.name "github-actions"
+      - name: Install Hugo
+        run: curl -OL https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.deb && sudo dpkg -i hugo_${HUGO_VERSION}_Linux-64bit.deb && rm -v hugo_*.deb
+      - name: Run build
+        run: ./publish_to_ghpages.sh
+      - name: Push commit
+        run: cd public && git push origin gh-pages