Bump @types/jest from 29.5.12 to 29.5.13 (#980) #1675
This file contains 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
# This workflow will do a clean install of node dependencies, 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: [main] | |
tags: | |
- v* | |
pull_request: | |
branches: [main] | |
env: | |
# TODO: Change variable to your image's name. | |
IMAGE_NAME: personal-web-admin | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
node-version: [18.x, 20.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Yarn build & test | |
run: | | |
yarn --frozen-lockfile | |
yarn test --coverage | |
yarn build | |
- name: Codecov | |
if: ${{ matrix.node-version == '18.x' }} | |
run: bash <(curl -s https://codecov.io/bash) | |
docker-test: | |
runs-on: ubuntu-22.04 | |
if: github.event_name == 'pull_request' | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run tests | |
run: docker build . --file Dockerfile | |
docker-push: | |
# Ensure test job passes before pushing image. | |
needs: build | |
runs-on: ubuntu-22.04 | |
if: github.event_name == 'push' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
bervproject/${{ env.IMAGE_NAME }} | |
ghcr.io/${{ github.repository }} | |
- name: Build and push Docker images | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |