|
| 1 | +name: Master Check & Publish |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + |
| 8 | +jobs: |
| 9 | + healthCheck: |
| 10 | + strategy: |
| 11 | + matrix: |
| 12 | + command: |
| 13 | + - typecheck |
| 14 | + - lint |
| 15 | + - format |
| 16 | + name: ${{ matrix.command }} |
| 17 | + runs-on: ubuntu-18.04 |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v1 |
| 20 | + - name: 'Cache yarn' |
| 21 | + uses: actions/cache@v1 |
| 22 | + with: |
| 23 | + path: ~/.cache/yarn |
| 24 | + key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} |
| 25 | + restore-keys: | |
| 26 | + ${{ runner.os }}-yarn- |
| 27 | + - name: 'Cache node_modules' |
| 28 | + uses: actions/cache@v1 |
| 29 | + with: |
| 30 | + path: ${{ github.workspace }}/node_modules |
| 31 | + key: ${{ runner.os }}-node_modules-${{ hashFiles('yarn.lock') }} |
| 32 | + restore-keys: | |
| 33 | + ${{ runner.os }}-node_modules- |
| 34 | + - name: 'Setup registry' |
| 35 | + run: | |
| 36 | + echo "//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" >> ~/.npmrc |
| 37 | + echo "@attest:registry=https://npm.pkg.github.com/" >> ~/.npmrc |
| 38 | + env: |
| 39 | + GITHUB_TOKEN: ${{ secrets.ADMIN_GH_TOKEN }} |
| 40 | + - name: 'Install dependencies' |
| 41 | + run: yarn install --frozen-lockfile |
| 42 | + - run: yarn ${{ matrix.command }} |
| 43 | + publish: |
| 44 | + needs: [healthCheck] |
| 45 | + runs-on: ubuntu-18.04 |
| 46 | + steps: |
| 47 | + - uses: actions/checkout@v1 |
| 48 | + - name: Configure Git |
| 49 | + run: | |
| 50 | + git --version |
| 51 | + git config --global user.email admin@askattest.com |
| 52 | + git config --global user.name attest-admin |
| 53 | + git remote rm origin |
| 54 | + git remote add origin "https://attest-admin:$GITHUB_TOKEN@github.com/attest/fe-tools.git" |
| 55 | + git checkout -b master |
| 56 | + git push -u origin master |
| 57 | + env: |
| 58 | + GITHUB_TOKEN: ${{ secrets.ADMIN_GH_TOKEN }} |
| 59 | + - name: 'Cache yarn' |
| 60 | + uses: actions/cache@v1 |
| 61 | + with: |
| 62 | + path: ~/.cache/yarn |
| 63 | + key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} |
| 64 | + restore-keys: | |
| 65 | + ${{ runner.os }}-yarn- |
| 66 | + - name: 'Cache node_modules' |
| 67 | + uses: actions/cache@v1 |
| 68 | + with: |
| 69 | + path: ${{ github.workspace }}/node_modules |
| 70 | + key: ${{ runner.os }}-node_modules-${{ hashFiles('yarn.lock') }} |
| 71 | + restore-keys: | |
| 72 | + ${{ runner.os }}-node_modules- |
| 73 | + - name: 'Setup registry' |
| 74 | + run: | |
| 75 | + echo "//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" >> ~/.npmrc |
| 76 | + echo "@attest:registry=https://npm.pkg.github.com/" >> ~/.npmrc |
| 77 | + env: |
| 78 | + GITHUB_TOKEN: ${{ secrets.ADMIN_GH_TOKEN }} |
| 79 | + - name: 'Install dependencies' |
| 80 | + run: yarn install --frozen-lockfile |
| 81 | + - name: Build |
| 82 | + run: yarn build |
| 83 | + - name: Version |
| 84 | + run: yarn semantic-release -d |
| 85 | + env: |
| 86 | + GH_TOKEN: ${{ secrets.ADMIN_GH_TOKEN }} |
0 commit comments