Skip to content

chore(deps): update dependency mongoose to v8.9.5 [security] #64

chore(deps): update dependency mongoose to v8.9.5 [security]

chore(deps): update dependency mongoose to v8.9.5 [security] #64

Workflow file for this run

name: Build and Publish Docker Image
on:
push:
branches:
- main
- develop
tags:
- "*.*.*"
pull_request:
branches:
- main
- develop
types:
- labeled
env:
REGISTRY_IMAGE: governify/registry
GHCR_IMAGE: governify/registry
PR_ID: ${{ github.event.pull_request.number }}
TAG: ${{ github.ref_name }}
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x]
steps:
- name: Checkout repository ⬇️
uses: actions/checkout@v4
- name: Set up Node.js ${{ matrix.node-version }} πŸ“¦πŸ› οΈ
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies πŸ“¦β¬‡οΈ
run: npm install
- name: Start the server πŸš€
run: npm run ci &
- name: Check server is running πŸƒ
run: curl -f http://localhost:5400 || exit 1
test:
name: Lint, test and coverage to coveralls πŸ§ͺ
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
node-version: [22.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: Install dependencies
run: npm ci
- name: Run tests
run: npm run test
env:
CI: true
docker:
runs-on: ubuntu-latest
needs: test
if: ((github.event.pull_request && github.event.label.name == '🐳 Dockerize') || github.event_name == 'push') && startsWith(github.repository, 'governify/')
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Checkout ⬇️
uses: actions/checkout@v4.2.2
with:
show-progress: false
- name: Configure QEMU βš™οΈ
uses: docker/setup-qemu-action@v3.3.0
- name: Configure Docker Buildx βš™οΈ
uses: docker/setup-buildx-action@v3.8.0
- name: Login to DockerHub πŸ”‘
uses: docker/login-action@v3.3.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry πŸ”‘
uses: docker/login-action@v3.3.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v6.11.0
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
${{ startsWith(github.ref, 'refs/tags/') && format('{0}:{1}', env.REGISTRY_IMAGE, env.TAG) || '' }}
${{ github.ref == 'refs/heads/main' && format('{0}:latest', env.REGISTRY_IMAGE) || '' }}
${{ github.ref == 'refs/heads/develop' && github.event_name == 'push' && format('{0}:develop', env.REGISTRY_IMAGE) || '' }}
${{ github.event_name == 'pull_request' && format('{0}:PR.{1}', env.REGISTRY_IMAGE, env.PR_ID) || '' }}
- name: Build and Push Ghcr Image
uses: docker/build-push-action@v6.11.0
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
${{ startsWith(github.ref, 'refs/tags/') && format('ghcr.io/{0}:{1}', env.GHCR_IMAGE, env.TAG) || '' }}
${{ github.ref == 'refs/heads/main' && format('ghcr.io/{0}:latest', env.GHCR_IMAGE) || '' }}
${{ github.ref == 'refs/heads/develop' && github.event_name == 'push' && format('ghcr.io/{0}:develop', env.GHCR_IMAGE) || '' }}
${{ github.event_name == 'pull_request' && format('ghcr.io/{0}:PR.{1}', env.GHCR_IMAGE, env.PR_ID) || '' }}