Skip to content

Commit

Permalink
Add mkdocs workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
albig committed Nov 1, 2023
1 parent 80f2f29 commit 858ecbd
Showing 1 changed file with 28 additions and 23 deletions.
51 changes: 28 additions & 23 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
NODE_VERSION: 18

jobs:
build:
build-deploy:
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -44,28 +44,10 @@ jobs:
- name: Make bundle
run: npm run bundle

build-zip:
runs-on: ubuntu-latest
permissions:
contents: write
needs: build
steps:
- uses: actions/checkout@v4
- name: fail on fork
if: github.repository_owner != 'verdigado'
run: exit 1

- name: Echo debug
run: |
echo "sunflower-${{ github.ref_name }}.zip"
ls -la
- name: Install Dependencies
run: npm ci

- name: Make bundle
run: npm run bundle

- name: Rename ZIP file
run: |
mv ../sunflower.zip sunflower-${{ github.ref_name }}.zip
Expand All @@ -77,12 +59,35 @@ jobs:
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }}

deploy:
- name: Provide deploy_key
env:
DEPLOY_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
run: |
mkdir "$HOME/.ssh"
echo "$DEPLOY_KEY" > "$HOME/.ssh/id_rsa"
file "$HOME/.ssh/id_rsa"
chmod 600 "$HOME/.ssh/id_rsa"
- name: save version
run: echo ${GITHUB_REF##*/} > version.txt

- name: rsync zipfile, version and changelog
run: rsync -a -e "ssh -o StrictHostKeyChecking=no -i $HOME/.ssh/id_rsa" ../sunflower-${{ github.ref_name }}.zip version.txt [email protected]:/var/www/updateserver/

mkdocs:
runs-on: ubuntu-latest
needs: build-zip
needs: build-deploy
steps:
- uses: actions/checkout@v4

- name: mkdocs build
uses: Tiryoh/actions-mkdocs@v0
with:
mkdocs_version: 'latest' # option
# mkdocs_version: '1.1' # option
# requirements: 'requirements.txt' # option
configfile: 'mkdocs/mkdocs.yml' # option

- name: Provide deploy_key
env:
DEPLOY_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
Expand All @@ -95,5 +100,5 @@ jobs:
- name: save version
run: echo ${GITHUB_REF##*/} > version.txt

- name: rsync zipfile, version and changelog
run: rsync -z -e "ssh -o StrictHostKeyChecking=no -i $HOME/.ssh/id_rsa" ../sunflower-${{ github.ref_name }}.zip version.txt [email protected]:/var/www/updateserver/
- name: rsync documentation
run: rsync -a -e "ssh -o StrictHostKeyChecking=no -i $HOME/.ssh/id_rsa" --delete documentation [email protected]:/var/www/documentation/

0 comments on commit 858ecbd

Please sign in to comment.