Update Installation-&-Configuration-Guides.md #75
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test and push to wiki | |
on: | |
push: | |
branches: | |
- main | |
- prettier | |
workflow_dispatch: | |
inputs: | |
deploy: | |
description: "Push to main wiki" | |
type: boolean | |
default: false | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
prettier: | |
name: Validate formatting with prettier | |
strategy: | |
fail-fast: true | |
continue-on-error: false | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.ref_name }} | |
fetch-depth: 0 | |
- name: add wiki push destination | |
if: github.ref_name == github.event.repository.default_branch | |
run: | | |
git remote set-url --add --push origin [email protected]:SickChill/SickChill.WikiTemp.wiki.git | |
- name: Prettify code | |
uses: creyD/[email protected] | |
with: | |
dry: ${{ github.ref_name == github.event.repository.default_branch }} | |
push_options: -f | |
prettier_options: --write **/*.{js,md} | |
deploy: | |
name: Deploy to main wiki | |
strategy: | |
fail-fast: true | |
continue-on-error: false | |
needs: prettier | |
runs-on: ubuntu-22.04 | |
env: | |
WIKIDIR: ./upstream | |
if: ${{ github.event.inputs.deploy }} | |
steps: | |
- name: Checkout Upstream | |
uses: actions/checkout@v3 | |
with: | |
repository: SickChill/sickchill.wiki | |
token: ${{ secrets.SICKCHILL_TOK }} | |
path: ${{ env.WIKIDIR }} | |
ref: master | |
fetch-depth: 0 | |
- name: Get changes from wikitemp | |
run: | | |
git remote add wikitemp https://github.com/SickChill/SickChill.WikiTemp.git | |
git fetch wikitemp | |
git reset --hard wikitemp/${{ github.ref_name }} | |
working-directory: ${{ env.WIKIDIR }} | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.SICKCHILL_TOK }} | |
repository: SickChill/sickchill.wiki | |
force: true | |
directory: ${{ env.WIKIDIR }} | |
branch: master |