Merge pull request #49 from krowter/feat/analytics #29
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
name: Master | |
on: | |
push: | |
branches: | |
- master | |
- main | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
ci: | |
name: CI | |
runs-on: ubuntu-latest | |
container: node:18-bullseye | |
timeout-minutes: 30 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: TruffleHog OSS | |
uses: trufflesecurity/trufflehog@main | |
continue-on-error: true | |
with: | |
path: ./ | |
base: ${{ github.event.repository.default_branch }} | |
head: HEAD | |
extra_args: --debug --only-verified | |
- name: Setup tzdata | |
run: apt-get update -y && apt-get upgrade -y && apt-get install -y tzdata | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: latest | |
- name: Install dependencies | |
run: pnpm install | |
- name: Lint | |
run: npx eslint --ignore-path .gitignore . | |
- name: Formatting | |
run: npx prettier --check **/*.{ts,astro,json,cjs,mjs} | |
- name: Build | |
run: pnpm run build | |
- name: Test | |
run: pnpm run test | |
env: | |
TZ: Asia/Jakarta | |
- uses: codecov/codecov-action@v3 | |
cd: | |
name: CD | |
needs: | |
- ci | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ghcr.io/${{ github.repository }} | |
flavor: | | |
latest=false | |
tags: | | |
type=edge | |
type=sha | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |