# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions name: Node.js CI on: push: branches: [ master ] pull_request: branches: [ master ] jobs: build: runs-on: ubuntu-latest strategy: matrix: node-version: [12.x, 14.x, 16.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} - run: npm install - run: npm run generate - run: npm run build --if-present - run: npm test - name: Login to DockerHub uses: docker/login-action@v1 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@v3 with: images: marcosperanza79/tms-ui tags: | type=sha,prefix={{branch}}- type=raw,value=latest - name: Build and push uses: docker/build-push-action@v2 with: context: . file: ./Dockerfile push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - name: Publish generated content to GitHub Pages if: ${{ matrix.node-version == '16.x' }} uses: tsunematsu21/actions-publish-gh-pages@v1.0.2 with: dir: coverage branch: gh-pages repo: marcosperanza/tms token: ${{ secrets.ACCESS_TOKEN }}