forked from billpratt/dotnet-search
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (33 loc) · 1.05 KB
/
docs.cd.yml
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
# This workflow builds and deploys an mkdocs site to GitHub Pages
name: "justinwritescode/docs cd"
on:
# Runs on pushes targeting the default branch
push:
branches:
- "main"
- "master"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
jobs:
calculate-folder-name:
runs-on: ubuntu-latest
steps:
- run: echo "FOLDER_NAME=$(echo '${{github.repository}}'|cut -d '/' -f 2)" >> $GITHUB_ENV
deploy-to-docs:
needs: calculate-folder-name
environment:
name: docs
url: https://docs.justinwritescode.com/${{env.FOLDER_NAME}}
runs-on: ubuntu-latest
steps:
- uses: justinwritescode/[email protected]
with:
repository_name: ${{github.repository}}
github_token: ${{secrets.GIT_TOKEN}}
branch: ${{github.ref_name}}
folder_name: ${{needs.calculate-folder-name.outputs.folder_name}}