From 49dfe6f7db25877d1f7714f6218b0eeed0a49446 Mon Sep 17 00:00:00 2001 From: Yan Lin Date: Fri, 30 Jan 2026 17:41:03 +0100 Subject: [PATCH] setup github actions --- .github/workflows/deploy.yml | 52 ++++++++++++++++++++++++++++++++++++ config.toml | 2 +- static/CNAME | 1 + 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy.yml create mode 100644 static/CNAME diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..107328a --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,52 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Zola + run: | + ZOLA_VERSION="0.19.2" + wget -q "https://github.com/getzola/zola/releases/download/v${ZOLA_VERSION}/zola-v${ZOLA_VERSION}-x86_64-unknown-linux-gnu.tar.gz" + tar -xzf "zola-v${ZOLA_VERSION}-x86_64-unknown-linux-gnu.tar.gz" + sudo mv zola /usr/local/bin/ + + - name: Build site + run: zola build + + - name: Setup Pages + uses: actions/configure-pages@v4 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./public + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/config.toml b/config.toml index 066de4a..070e88c 100644 --- a/config.toml +++ b/config.toml @@ -1,4 +1,4 @@ -base_url = "https://blog.yanlincs.com" +base_url = "https://zola.yanlincs.com" title = "Yan Lin's Blog" description = "Personal blog of Yan Lin, Postdoctoral Researcher at Aalborg University" default_language = "en" diff --git a/static/CNAME b/static/CNAME new file mode 100644 index 0000000..babad8e --- /dev/null +++ b/static/CNAME @@ -0,0 +1 @@ +zola.yanlincs.com