-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (56 loc) · 1.57 KB
/
deploy.yml
File metadata and controls
61 lines (56 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Zola on GitHub Pages
on:
push:
branches:
- main
pull_request:
types:
- opened
- reopened
- synchronize
- closed
concurrency: preview-${{ github.ref }}
permissions: {}
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
pull-requests: write
if: github.ref != 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Build only
if: github.event.action != 'closed'
uses: shalzz/zola-deploy-action@90cd842959b82e0c012601be18ae249d6cdb1669 # v0.21
env:
BUILD_DIR: .
BUILD_ONLY: true
BUILD_FLAGS: --drafts --base-url https://sinon.github.io/pr-preview/pr-${{ github.event.number }}/
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy preview
uses: rossjrw/pr-preview-action@2fb559e4766555e23d07b73d313fe97c4f8c3cfe # v1.6.1
with:
source-dir: ./public/
pages-base-url: sinon.github.io
build_and_deploy:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Build and deploy
uses: shalzz/zola-deploy-action@90cd842959b82e0c012601be18ae249d6cdb1669 # v0.21
env:
BUILD_DIR: .
PAGES_BRANCH: gh-pages
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}