Skip to content

Commit

Permalink
chore: prepare for contribution
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Glastra <[email protected]>
  • Loading branch information
TimoGlastra committed Jan 8, 2025
1 parent ad37209 commit 2219622
Show file tree
Hide file tree
Showing 41 changed files with 11,762 additions and 6,051 deletions.
10 changes: 10 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
NODE_ENV=development

# POSTGRES_USER=
# POSTGRES_PASSWORD=
# POSTGRES_HOST=
# POSTGRES_ADMIN_USER=
# POSTGRES_ADMIN_PASSWORD=

# USE_PUSH_NOTIFICATIONS='true'
# NOTIFICATION_WEBHOOK_URL=
5 changes: 1 addition & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,4 @@ POSTGRES_ADMIN_USER=
POSTGRES_ADMIN_PASSWORD=

USE_PUSH_NOTIFICATIONS='true'
NOTIFICATION_WEBHOOK_URL=

# We need NGROK Auth token in development and you can get one from here https://dashboard.ngrok.com/get-started/your-authtoken
NGROK_AUTH_TOKEN=
NOTIFICATION_WEBHOOK_URL=
46 changes: 0 additions & 46 deletions .github/actions/deploy/action.yml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/actions/publish-docker-image/action.yml

This file was deleted.

76 changes: 76 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Continuous Integration

on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
validate:
runs-on: ubuntu-20.04
name: Validate
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Check Style
run: pnpm style:check

- name: Check Types
run: pnpm types:check

- name: Compile
run: pnpm build

tests:
runs-on: ubuntu-20.04
name: Tests

strategy:
fail-fast: false
matrix:
node-version: [20]

steps:
- name: Checkout Repo
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
- name: Setup NodeJS
id: setup-node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

# See https://github.com/actions/setup-node/issues/641#issuecomment-1358859686
- name: pnpm cache path
id: pnpm-cache-path
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache-path.outputs.STORE_PATH }}
key: ${{ runner.os }}-${{ steps.setup-node.outputs.node-version }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-${{ steps.setup-node.outputs.node-version }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run tests
run: pnpm test
37 changes: 0 additions & 37 deletions .github/workflows/continuous-integration.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/deploy-stack.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/publish-images.yaml

This file was deleted.

39 changes: 32 additions & 7 deletions .github/workflows/release-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,50 @@ on:
tags:
- v*

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
release-image:
name: Release Image to Github Registry
runs-on: ubuntu-20.04

permissions:
contents: read
packages: write
attestations: write
id-token: write

steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ghcr.io
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and Publish Mediator
uses: ./.github/actions/publish-docker-image
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
id: push
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
image-name: ghcr.io/animo/animo-mediator
context: .
docker-file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
DS_Store
build
node_modules
.env
.env
.env.local
5 changes: 0 additions & 5 deletions .prettierrc.json

This file was deleted.

Loading

0 comments on commit 2219622

Please sign in to comment.