feat(kubernetes): complete checkpoint 30 - scaling deployments #65
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Node CI | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - name: Install dependencies | |
| run: npm install | |
| working-directory: labs/github-actions/testing-lab | |
| - name: Run tests | |
| run: npm test | |
| working-directory: labs/github-actions/testing-lab | |
| - name: Build Docker image | |
| run: | | |
| docker build \ | |
| -t my-first-image \ | |
| labs/docker/dockerfile-lab | |
| - name: Scan Docker image with Trivy | |
| uses: aquasecurity/trivy-action@master | |
| with: | |
| image-ref: my-first-image | |
| format: table | |
| severity: CRITICAL | |
| exit-code: 0 | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_TOKEN }} | |
| - name: Push Docker image | |
| run: | | |
| docker tag my-first-image wendev27/my-first-image:latest | |
| docker push wendev27/my-first-image:latest |