ff392e0e7e
* Initial Methods for SpearheadAPI * Added Spearhead API * Added Spearhead API * fixed compile for api * Added notes for API in beta * Added notes for API in beta * Added Menu to all doc pages * Added Menu to all doc pages * added it for real * added it for real * fixed develop * fixed develop * fixed develop * wip * wip * updated * work in progress * work in progress * added empty docs page * wip * removed SAR files from persistence branch * Added Blue Sams as seperate class * added initial persistance * added initial persistance * added initial persistance * added initial persistance * added initial persistance * added menu to persistence markdown * added menu to persistence markdown * added menu to persistence markdown * docs update * wip * wip * Refactor of Stage classes. * wip * wip * wip * reworked bluesam and stagebase * Added waiting stage functionality * updated docs * wip * wip * wip * updated * wip * wip * wip * refactored without issues, needs testing --------- Co-authored-by: Dutchie <54616262+dutchie032@users.noreply.github.com> Co-authored-by: dutchie032 <dutchie032> Co-authored-by: ex61wi <tim.rorije@ing.com>
104 lines
3.8 KiB
YAML
104 lines
3.8 KiB
YAML
#start
|
|
|
|
name: Release
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- develop
|
|
|
|
jobs:
|
|
buildandpush:
|
|
name: push_file
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
branch: main
|
|
username: dutchie032
|
|
repo: dutchie032.github.io
|
|
sourcefileB: GetStarted
|
|
defaults:
|
|
run:
|
|
working-directory: .
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
path: './spearhead'
|
|
- name: ls
|
|
run: ls
|
|
- name: Setup credentials to access private repositories
|
|
run: git config --global url.https://${{ secrets.API_TOKEN_GITHUB }}@github.com/.insteadOf https://github.com/
|
|
- name: Git Config
|
|
run: git config --global user.email "automated@action.com"
|
|
- name: Git Config
|
|
run: git config --global user.name "automated action"
|
|
- name: clone
|
|
run: git clone --single-branch --branch $branch https://github.com/$username/$repo
|
|
|
|
|
|
- name: commit
|
|
run: git pull --rebase
|
|
working-directory: ./dutchie032.github.io
|
|
|
|
- name: ls
|
|
run: ls
|
|
- name: Replace strings in file
|
|
run: |
|
|
import os
|
|
import datetime
|
|
|
|
def replace(fileName, search, replace):
|
|
with open(fileName) as f:
|
|
newText=f.read().replace(search, replace)
|
|
|
|
with open(fileName, "w") as f:
|
|
f.write(newText)
|
|
|
|
with open("./spearhead/config.lua", "r") as luaFile:
|
|
luaConfig = luaFile.read()
|
|
replace("./spearhead/_docs/Reference.md", "##!config!##", luaConfig)
|
|
|
|
lastUpdateTime = datetime.datetime.now().isoformat()
|
|
menu = ""
|
|
with open("./spearhead/_docs/menu.html", "r") as menuFile:
|
|
menu = menuFile.read()
|
|
|
|
files = [ "Reference.md", "GetStarted.md", "SpearheadApi.md", "Persistence.md" ]
|
|
for file in files:
|
|
replace(f"./spearhead/_docs/{file}", "##!lastupdatetime!##", lastUpdateTime)
|
|
with open(f"./spearhead/_docs/{file}", "a") as f:
|
|
f.write(menu)
|
|
|
|
|
|
shell: python
|
|
|
|
- name: mkdir
|
|
run: mkdir -p ./$repo/Spearhead
|
|
- run: npm i markdown-to-html-cli -g
|
|
- run: markdown-to-html --title 'Spearhead' --dark-mode auto --keywords "dcs,spearhead,tdcs,mission,campaign,tactical dcs,tactical" --no-dark-mode --markdown-style-theme dark --source ./spearhead/_docs/Reference.md --output ./$repo/Spearhead/Reference.html
|
|
- run: markdown-to-html --title 'Spearhead' --dark-mode auto --keywords "dcs,spearhead,tdcs,mission,campaign,tactical dcs,tactical" --no-dark-mode --markdown-style-theme dark --source ./spearhead/_docs/GetStarted.md --output ./$repo/Spearhead/GetStarted.html
|
|
- run: markdown-to-html --title 'Spearhead' --dark-mode auto --keywords "dcs,spearhead,tdcs,mission,campaign,tactical dcs,tactical" --no-dark-mode --markdown-style-theme dark --source ./spearhead/_docs/SpearheadApi.md --output ./$repo/Spearhead/SpearheadApi.html
|
|
- run: markdown-to-html --title 'Spearhead' --dark-mode auto --keywords "dcs,spearhead,tdcs,mission,campaign,tactical dcs,tactical" --no-dark-mode --markdown-style-theme dark --source ./spearhead/_docs/Persistence.md --output ./$repo/Spearhead/Persistence.html
|
|
|
|
- run: python3 ./spearhead/SpearheadCompile.py "./spearhead" "./$repo/Spearhead/spearhead.lua"
|
|
if: github.ref == 'refs/heads/main'
|
|
|
|
- run: mkdir -p ./$repo/Spearhead/beta
|
|
if: github.ref == 'refs/heads/develop'
|
|
|
|
- run: python3 ./spearhead/SpearheadCompile.py "./spearhead" "./$repo/Spearhead/beta/spearhead.lua"
|
|
if: github.ref == 'refs/heads/develop'
|
|
|
|
- run: cp -a ./spearhead/_docs/img/. ./$repo/Spearhead/img/
|
|
- name: ls
|
|
run: ls
|
|
working-directory: ./dutchie032.github.io
|
|
- name: add
|
|
run: git add --a
|
|
working-directory: ./dutchie032.github.io
|
|
- name: commit
|
|
run: git commit -a -m "Automatic Update of Spearhead README"
|
|
working-directory: ./dutchie032.github.io
|
|
- name: push
|
|
run: git push
|
|
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main'
|
|
working-directory: ./dutchie032.github.io |