|
| 1 | +--- |
| 2 | +name: Deployment Stage |
| 3 | +on: |
| 4 | + workflow_dispatch |
| 5 | + |
| 6 | +jobs: |
| 7 | + set-state: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + outputs: |
| 10 | + path_prefix: ${{ steps.get_path_prefix.outputs.path_prefix }} |
| 11 | + branch_short_ref: ${{ steps.get_branch.outputs.branch }} |
| 12 | + steps: |
| 13 | + - name: Checkout |
| 14 | + uses: actions/checkout@v3 |
| 15 | + |
| 16 | + - name: Get pathPrefix |
| 17 | + uses: actions/github-script@v6 |
| 18 | + id: get_path_prefix |
| 19 | + with: |
| 20 | + script: | |
| 21 | + const script = require('./.github/scripts/get-path-prefix.js'); |
| 22 | + script({ core }); |
| 23 | + result-encoding: string |
| 24 | + - name: Get branch name |
| 25 | + shell: bash |
| 26 | + run: echo "branch=${GITHUB_REF#refs/heads/}" >> "$GITHUB_OUTPUT" |
| 27 | + id: get_branch |
| 28 | + |
| 29 | + echo-state: |
| 30 | + needs: [set-state] |
| 31 | + runs-on: ubuntu-latest |
| 32 | + steps: |
| 33 | + - run: echo "Repository org - ${{ github.event.repository.owner.login }}" |
| 34 | + - run: echo "Repository name - ${{ github.event.repository.name }}" |
| 35 | + - run: echo "Repository branch - ${{ needs.set-state.outputs.branch_short_ref }}" |
| 36 | + - run: echo "Path prefix - ${{ needs.set-state.outputs.path_prefix }}" |
| 37 | + |
| 38 | + |
| 39 | + build: |
| 40 | + defaults: |
| 41 | + run: |
| 42 | + shell: bash |
| 43 | + needs: [set-state] |
| 44 | + runs-on: ubuntu-latest |
| 45 | + steps: |
| 46 | + - name: Checkout |
| 47 | + uses: actions/checkout@v3 |
| 48 | + |
| 49 | + - name: Setup Node v16 for Yarn v3 |
| 50 | + uses: actions/setup-node@v3 |
| 51 | + with: |
| 52 | + node-version: "16.15.0" # Current LTS version |
| 53 | + |
| 54 | + - name: Enable Corepack for Yarn v3 |
| 55 | + run: corepack enable |
| 56 | + |
| 57 | + - name: Install Yarn v3 |
| 58 | + uses: borales/actions-yarn@v3 |
| 59 | + with: |
| 60 | + cmd: set version stable |
| 61 | + |
| 62 | + - name: Install Dependencies |
| 63 | + uses: borales/actions-yarn@v3 |
| 64 | + env: |
| 65 | + YARN_ENABLE_IMMUTABLE_INSTALLS: false |
| 66 | + with: |
| 67 | + cmd: install |
| 68 | + |
| 69 | + - name: Build navigation file |
| 70 | + uses: borales/actions-yarn@v3 |
| 71 | + with: |
| 72 | + cmd: buildNavigation |
| 73 | + |
| 74 | + - name: Publish markdown files in ./src/pages |
| 75 | + run: | |
| 76 | + bash .github/scripts/publish-mds-stage.sh "./src/pages" "${{ needs.set-state.outputs.path_prefix }}" |
0 commit comments