-
Notifications
You must be signed in to change notification settings - Fork 11
66 lines (55 loc) · 1.54 KB
/
PublishIndex.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Build and Publish
on:
push:
branches: [ main ]
tags:
- '*'
pull_request:
branches: [ main ]
workflow_dispatch:
env:
TEMP_PATH: ./Temp
TOOL_PATH: ./Temp/Tool
PUBLISH_PATH: ./Temp/Publish
TOOL_NAME: Reloaded.Community.Tool.exe
jobs:
build:
runs-on: windows-2022
defaults:
run:
shell: pwsh
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET Core SDK (5.0)
uses: actions/[email protected]
with:
dotnet-version: 5.0.x
- name: Create Output Directories
run: |
[System.IO.Directory]::CreateDirectory("$env:TOOL_PATH")
[System.IO.Directory]::CreateDirectory("$env:PUBLISH_PATH")
- name: Download Community Tool
id: download_release_asset
uses: i3h/download-release-asset@v1
with:
owner: Reloaded-Project
repo: Reloaded.Community
tag: latest
file: ${{ env.TOOL_NAME }}
path: ${{ env.TOOL_PATH }}
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: Print File Contents
run: |
Get-ChildItem "$env:TEMP_PATH" -Recurse
- name: Build Index
run: |
& "$env:TOOL_PATH/$env:TOOL_NAME" buildIndex --source "." --destination $env:PUBLISH_PATH
- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
build_dir: ${{ env.PUBLISH_PATH }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}