Skip to content

Only create docs on push to master #47

Only create docs on push to master

Only create docs on push to master #47

Workflow file for this run

# Name of the project in the GitHub action panel
name: Run-Tests-and-Generate-Model-Diagram
# Execute the CI on push on the master branch
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
# List of images at https://github.com/hpi-swa/smalltalkCI#images
# Use Moose 10 that includes our visualization tool
smalltalk: [ Moose64-10]
name: ${{ matrix.smalltalk }}
steps:
# checkout the project
- uses: actions/checkout@v3
# Prepare the CI - download the correct VM :-)
- uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalk-image: ${{ matrix.smalltalk }}
# Use the CI - always better to run test
- run: smalltalkci -s ${{ matrix.smalltalk }}
shell: bash
timeout-minutes: 15
update_docs:
needs: build
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
steps:
- name: Generate plantuml representation of meta-model
run: |
$SMALLTALK_CI_VM $SMALLTALK_CI_IMAGE eval "'FamixTypeScript.puml' asFileReference writeStreamDo: [ :stream | stream nextPutAll: (FamixMMUMLDocumentor new withModel: FamixTypeScriptModel andColor: Color lightBlue ; beWithStub; generatePlantUMLModel)]"
- name: Generate SVG Diagram from PlantUML
uses: Timmy/plantuml-action@v1
with:
args: -v -tsvg FamixTypeScript.puml
- name: Move diagram to doc space
run: |
mkdir doc-uml
mv *.svg doc-uml
- name: Init new repo in doc-uml folder and commit generated files
run: |
cd doc-uml/
git init
git add -A
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -m 'update doc'
# Careful, this can kill your project
- name: Force push to destination branch
uses: ad-m/github-push-action@master
with:
# Token for the repo. Can be passed in using $\{{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
force: true
# Destination branch to push changes
branch: v1/doc
# We have to push from the folder where files were generated.
# Same were the new repo was initialized in the previous step
directory: ./doc-uml