From 5855b6f1706c2ac1ecc3951eebb02682613c8756 Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Sat, 21 Aug 2021 10:34:54 -0400 Subject: [PATCH] Experimenting with CI --- .github/workflows/zola.yml | 42 +++++++++++++++----------------------- vercel.json | 19 +++++++++++++++++ 2 files changed, 36 insertions(+), 25 deletions(-) create mode 100644 vercel.json diff --git a/.github/workflows/zola.yml b/.github/workflows/zola.yml index d4a0baf..85c1aec 100644 --- a/.github/workflows/zola.yml +++ b/.github/workflows/zola.yml @@ -1,32 +1,24 @@ +name: CI + on: push: - branches: - - master - pull_request: + branches: [master] jobs: build: runs-on: ubuntu-latest - if: github.ref != 'refs/heads/master' + steps: - - name: 'Checkout' - uses: actions/checkout@master - - name: 'Build only' - uses: shalzz/zola-deploy-action@master - env: - BUILD_DIR: . - TOKEN: ${{ secrets.GITHUB_TOKEN }} - BUILD_ONLY: true - - build_and_deploy: - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/master' - steps: - - name: 'Checkout' - uses: actions/checkout@master - - name: 'Build and deploy' - uses: shalzz/zola-deploy-action@master - env: - PAGES_BRANCH: gh-pages - BUILD_DIR: . - TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + - uses: actions/checkout@v2 + - name: Install and Run Zola + run: | + sudo snap install --edge zola + zola build + + - uses: amondnet/vercel-action@v19 + with: + vercel-token: ${{ secrets.VERCEL_TOKEN }} + github-token: ${{ secrets.GITHUB_TOKEN }} + vercel-org-id: ${{ secrets.ORG_ID}} + vercel-project-id: ${{ secrets.PROJECT_ID}} + working-directory: ./public \ No newline at end of file diff --git a/vercel.json b/vercel.json new file mode 100644 index 0000000..c3f9f0f --- /dev/null +++ b/vercel.json @@ -0,0 +1,19 @@ +{ + "version": 2, + "public": false, + "github": { + "enabled": false + }, + "builds": [ + { + "src": "./public/**", + "use": "@now/static" + } + ], + "routes": [ + { + "src": "/(.*)", + "dest": "public/$1" + } + ] +} \ No newline at end of file