Skip to content

Commit

Permalink
Merge pull request #6 from pinax-network/github-workflows
Browse files Browse the repository at this point in the history
add github workflows
  • Loading branch information
DenisCarriere authored Mar 2, 2024
2 parents c69c0ff + 6226f05 commit 852bf85
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/bun-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Bun Test

on: push

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- run: bun install
- run: bun run test
42 changes: 42 additions & 0 deletions .github/workflows/ghcr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: GitHub Container Registry
on:
release:
types: [ published ]

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

jobs:
build-and-push-image:
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: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{raw}}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
19 changes: 19 additions & 0 deletions .github/workflows/npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: NPM Registry
on:
release:
types: [ published ]

jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18.x'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM oven/bun
COPY . .
RUN bun install
ENTRYPOINT [ "bun", "./index.ts" ]

0 comments on commit 852bf85

Please sign in to comment.