|
| 1 | +# This is a basic workflow to help you get started with Actions |
| 2 | + |
| 3 | +name: MAIN_PUSH |
| 4 | + |
| 5 | +# Controls when the action will run. |
| 6 | +on: |
| 7 | + # Triggers the workflow on push or pull request events but only for the dev branch |
| 8 | + push: |
| 9 | + branches: ['main'] |
| 10 | + |
| 11 | + # Allows you to run this workflow manually from the Actions tab |
| 12 | + workflow_dispatch: |
| 13 | + |
| 14 | +# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
| 15 | +jobs: |
| 16 | + eslint: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + defaults: |
| 19 | + run: |
| 20 | + working-directory: ./ |
| 21 | + steps: |
| 22 | + - name: Checkout branch main |
| 23 | + uses: actions/checkout@v2 |
| 24 | + |
| 25 | + - uses: actions/setup-node@v1 |
| 26 | + with: |
| 27 | + node-version: '16.x' |
| 28 | + |
| 29 | + - name: Install project dependencies |
| 30 | + run: npm install |
| 31 | + |
| 32 | + - name: Run lint |
| 33 | + run: npm run lint |
| 34 | + |
| 35 | + compile-code: |
| 36 | + needs: eslint |
| 37 | + runs-on: ubuntu-latest |
| 38 | + steps: |
| 39 | + - name: Checkout branch dev |
| 40 | + uses: actions/checkout@v2 |
| 41 | + |
| 42 | + - uses: actions/setup-node@v1 |
| 43 | + with: |
| 44 | + node-version: '16.x' |
| 45 | + |
| 46 | + - name: Install project dependencies |
| 47 | + run: npm install |
| 48 | + |
| 49 | + - name: Compile code |
| 50 | + run: npm run build |
| 51 | + |
| 52 | + documentation: |
| 53 | + needs: compile-code |
| 54 | + runs-on: ubuntu-latest |
| 55 | + |
| 56 | + # Steps represent a sequence of tasks that will be executed as part of the job |
| 57 | + steps: |
| 58 | + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
| 59 | + - name: Checkout branch main |
| 60 | + uses: actions/checkout@v3 |
| 61 | + with: |
| 62 | + ref: dev |
| 63 | + token: ${{ secrets.PAT }} |
| 64 | + |
| 65 | + - name: Install graphviz |
| 66 | + run: sudo apt install -y graphviz |
| 67 | + |
| 68 | + - uses: actions/setup-node@v3 |
| 69 | + with: |
| 70 | + node-version: 16 |
| 71 | + cache: 'npm' |
| 72 | + |
| 73 | + - name: Install project dependencies |
| 74 | + run: npm install |
| 75 | + |
| 76 | + - name: Generate documentation |
| 77 | + run: npm run docs |
| 78 | + |
| 79 | + - name: Sign and commit documentation to branch dev |
| 80 | + uses: ./.github/os-git-actions/signed-commit/ |
| 81 | + with: |
| 82 | + branch: main |
| 83 | + message: 'Update documentation [skip ci]' |
| 84 | + newFiles: true |
| 85 | + gpgPriv: ${{ secrets.GPG_SIGN_KEY }} |
| 86 | + gpgPassPhrase: ${{ secrets.GPG_PASSPHRASE }} |
0 commit comments