Skip to content

tests

tests #47

Workflow file for this run

name: Build, Test & Publish
on:
push:
branches: [main]
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '22'
- name: Install dependencies
run: npm install
- name: Run Jest tests
run: npm test
push_to_registries:
name: Push Docker image to multiple registries
runs-on: ubuntu-latest
needs: test
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Check out repository code 🛎️
uses: actions/checkout@v4
- name: Set up Docker Buildx 🚀
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub 🚢
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME}}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN}}
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push 🏗️
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: |
${{ secrets.DOCKER_HUB_USERNAME}}/docker-staticmaps:${{ github.sha }}
${{ secrets.DOCKER_HUB_USERNAME}}/docker-staticmaps:latest
ghcr.io/${{ github.repository }}:${{ github.sha }}
ghcr.io/${{ github.repository }}:latest