Skip to content

Show email confirmation status of the user in the settings page and resent the confirmation mail. #2014

Show email confirmation status of the user in the settings page and resent the confirmation mail.

Show email confirmation status of the user in the settings page and resent the confirmation mail. #2014

Workflow file for this run

name: πŸ—οΈ Build
on:
push:
branches:
- main
- dev
pull_request: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
actions: write
contents: read
packages: write
jobs:
lint:
name: ⬣ Lint
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v6
- name: βŽ” Setup node
uses: actions/setup-node@v6
with:
cache: npm
cache-dependency-path: ./package.json
node-version-file: .nvmrc
- name: πŸ“₯ Install deps
run: npm install
- name: πŸ”¬ Lint
run: npm run lint
typecheck:
name: Κ¦ TypeScript
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v6
- name: βŽ” Setup node
uses: actions/setup-node@v6
with:
cache: npm
cache-dependency-path: ./package.json
node-version-file: .nvmrc
- name: πŸ“₯ Install deps
run: npm install
- name: πŸ”Ž Type check
run: npm run typecheck --if-present
vitest:
name: ⚑ Test
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v6
- name: πŸ„ Copy test env vars
run: cp .env.example .env
- name: βŽ” Setup node
uses: actions/setup-node@v6
with:
cache: npm
cache-dependency-path: ./package.json
node-version-file: .nvmrc
- name: πŸ“₯ Install deps
run: npm install
- name: 🐳 Docker compose
# we need a postgres container for runnign the tests
# the sleep is just there to give time for postgres to get started
run: docker compose -f docker-compose.ci.yml up -d && sleep 30
env:
DATABASE_URL: 'postgresql://postgres:postgres@localhost:5432/postgres'
- name: πŸ›  Setup Database
uses: nick-fields/retry@v3.0.2
with:
timeout_minutes: 10
max_attempts: 5
retry_wait_seconds: 45
retry_on: error
command: npm run db:migrate
- name: ⚑ Run vitest
run: npm run test:coverage
- name: 🧐 Report Coverage
uses: davelosert/vitest-coverage-report-action@v2
- name: πŸ—‘οΈ Cleanup
if: always()
run: docker compose down
build:
name: 🐳 Build
# only build/deploy main branch on pushes
# if: ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v6
- name: 🐳 Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: v0.9.1
# Setup cache
- name: ⚑️ Cache Docker layers
uses: actions/cache@v5
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: πŸ“‹ Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/opensensemap/frontend
- name: πŸ‘“ Read .nvmrc
id: nvmrc
run: |
echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT
- name: πŸ”‘ GitHub Registry Auth
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 🐳 Docker build
uses: docker/build-push-action@v6
with:
context: .
file: ./other/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
COMMIT_SHA=${{ github.sha }}
NODE_VERSION=${{ steps.nvmrc.outputs.NODE_VERSION }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new
# This ugly bit is necessary if you don't want your cache to grow forever
# till it hits GitHub's limit of 5GB.
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: 🚚 Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache