Repository navigation
Feat/container #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f4c0b01
wip
Valdr687 5b9be1c
chore: Update JS and fix an error code
Valdr687 02d7acc
feat: publish, and more graceful stop handling
Valdr687 25083d4
simplify the sigkill
Valdr687 c9204ad
remove z flag
Valdr687 5094d16
init and better path
Valdr687 0e38522
edit CI
Valdr687 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| node_modules | ||
| dist | ||
| .git | ||
| .env | ||
| .gitignore |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # Copy this file to .env and fill in the values | ||
|
|
||
| # Url to send the filtered webhooks to (required) | ||
| WEBHOOK_URL= | ||
|
|
||
| # Set to true to drop events not defined in filterConfiguration.json | ||
| BLOCK_UNDEFINED_EVENTS=false | ||
|
|
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| release: | ||
| types: [published] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| check: | ||
| name: Build and type check | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 | ||
| with: | ||
| node-version: 26 | ||
| cache: npm | ||
|
|
||
| - run: npm ci | ||
| - run: npm run build | ||
|
|
||
| container: | ||
| name: Build image | ||
| needs: check | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 | ||
|
|
||
| - uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 | ||
| if: github.event_name == 'release' | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - id: meta | ||
| uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0 | ||
| with: | ||
| images: ghcr.io/${{ github.repository }} | ||
| # Stable releases also get the latest and major.minor tags, | ||
| # prereleases get only their exact version tag. | ||
| tags: | | ||
| type=semver,pattern={{version}} | ||
| type=semver,pattern={{major}}.{{minor}} | ||
|
|
||
| - uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0 | ||
| with: | ||
| context: . | ||
| platforms: linux/amd64 | ||
| push: ${{ github.event_name == 'release' }} | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| node_modules | ||
| dist | ||
| .env |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # Build stage: compile the TypeScript sources | ||
| FROM node:26.12.1-alpine AS build | ||
|
Valdr687 marked this conversation as resolved.
Resolved
|
||
|
|
||
| WORKDIR /app | ||
|
|
||
| COPY package*.json ./ | ||
| RUN npm ci | ||
|
|
||
| COPY tsconfig.json ./ | ||
| COPY src ./src | ||
| RUN npm run build | ||
|
|
||
| # Drop dev dependencies so node_modules can be reused as-is in the runtime stage | ||
| RUN npm prune --omit=dev | ||
|
|
||
| # Runtime stage: only production dependencies and compiled output | ||
| FROM node:26.12.1-alpine | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| ENV NODE_ENV=production | ||
| # Listen on all interfaces so the server is reachable from outside the container | ||
| ENV HOST=0.0.0.0 | ||
| ENV PORT=3000 | ||
|
|
||
| COPY --from=build --chown=node:node /app/package*.json ./ | ||
| COPY --from=build --chown=node:node /app/node_modules ./node_modules | ||
| COPY --from=build --chown=node:node /app/dist ./dist | ||
|
|
||
|
|
||
| # Run as the unprivileged user provided by the node image | ||
| USER node | ||
|
|
||
| EXPOSE 3000 | ||
|
|
||
| # WEBHOOK_URL must be provided at runtime, e.g. `docker run -e WEBHOOK_URL=...` | ||
| CMD ["node", "dist/src/server.js"] | ||
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| services: | ||
| github-webhook-filter: | ||
|
Valdr687 marked this conversation as resolved.
Resolved
|
||
| image: ghcr.io/rezoleo/github-webhook-filter:1.0.0 | ||
| container_name: github-webhook-filter | ||
| init: true | ||
| ports: | ||
| - 3000:3000 | ||
| environment: | ||
| # URL to send the events to | ||
| - WEBHOOK_URL=${WEBHOOK_URL:?WEBHOOK_URL is required} | ||
| # Choose wether to block events other than those defined in filterConfiguration | ||
| - BLOCK_UNDEFINED_EVENTS=${BLOCK_UNDEFINED_EVENTS:-false} | ||
| volumes: | ||
| # Edit the filters without rebuilding the image, restart the container to apply them | ||
| - ./path/to/filterConfiguration.json:/app/dist/src/filterConfiguration.json:ro | ||
| restart: unless-stopped | ||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️