|
| 1 | +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node |
| 2 | +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions |
| 3 | + |
| 4 | +name: Build & Release |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + pull_request: |
| 9 | + branches: |
| 10 | + - master |
| 11 | + |
| 12 | +jobs: |
| 13 | + lint: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + node-version: [ 14.x ] |
| 18 | + |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v2 |
| 21 | + - name: Use Node.js ${{ matrix.node-version }} |
| 22 | + uses: actions/setup-node@v1 |
| 23 | + with: |
| 24 | + node-version: ${{ matrix.node-version }} |
| 25 | + - name: Install dependencies |
| 26 | + run: yarn install --frozen-lockfile --network-timeout 500000 |
| 27 | + - name: Run lint |
| 28 | + run: yarn lint |
| 29 | + |
| 30 | + test: |
| 31 | + runs-on: ${{ matrix.os }} |
| 32 | + |
| 33 | + strategy: |
| 34 | + matrix: |
| 35 | + os: [ubuntu-latest] |
| 36 | + node-version: [ 14.x ] |
| 37 | + |
| 38 | + steps: |
| 39 | + - uses: actions/checkout@v2 |
| 40 | + - name: Use Node.js ${{ matrix.node-version }} |
| 41 | + uses: actions/setup-node@v1 |
| 42 | + with: |
| 43 | + node-version: ${{ matrix.node-version }} |
| 44 | + - name: Install dependencies |
| 45 | + run: yarn install --frozen-lockfile --network-timeout 500000 |
| 46 | + - name: Run test |
| 47 | + run: yarn test |
| 48 | + |
| 49 | + deploy: |
| 50 | + runs-on: ubuntu-latest |
| 51 | + needs: [lint, test] |
| 52 | + if: ${{ github.event_name != 'pull_request' && (contains(github.ref, 'master') || contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc')) }} |
| 53 | + |
| 54 | + strategy: |
| 55 | + matrix: |
| 56 | + node-version: [ 14.x ] |
| 57 | + |
| 58 | + steps: |
| 59 | + - uses: actions/checkout@v2 |
| 60 | + - name: Use Node.js ${{ matrix.node-version }} |
| 61 | + uses: actions/setup-node@v1 |
| 62 | + with: |
| 63 | + node-version: ${{ matrix.node-version }} |
| 64 | + - name: Install dependencies |
| 65 | + run: yarn install --frozen-lockfile --network-timeout 500000 |
| 66 | + |
| 67 | + - name: Build app |
| 68 | + run: yarn build |
| 69 | + |
| 70 | + - name: Login to Heroku Container Registry |
| 71 | + env: |
| 72 | + HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} |
| 73 | + run: heroku container:login |
| 74 | + |
| 75 | + - name: Build and push |
| 76 | + env: |
| 77 | + HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} |
| 78 | + run: heroku container:push -a ${{ secrets.HEROKU_APP_NAME }} web |
| 79 | + |
| 80 | + - name: Release |
| 81 | + env: |
| 82 | + HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} |
| 83 | + run: heroku container:release -a ${{ secrets.HEROKU_APP_NAME }} web |
| 84 | + |
| 85 | + - uses: actions/upload-artifact@v2 |
| 86 | + with: |
| 87 | + name: packages |
| 88 | + path: | |
| 89 | + package.json |
| 90 | + packages/*/package.json |
0 commit comments