-
-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #222 from gaby/docker
Add support for Docker
- Loading branch information
Showing
5 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
node_modules | ||
npm-debug.log | ||
.git | ||
.gitignore | ||
.env | ||
.env.* | ||
*.md | ||
.vscode | ||
coverage | ||
.nyc_output | ||
dist | ||
build |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Docker | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
paths-ignore: | ||
- "**.md" | ||
- LICENSE | ||
pull_request: | ||
branches: | ||
- "*" | ||
paths: | ||
- "Dockerfile" | ||
- ".dockerignore" | ||
- ".github/workflows/docker.yml" | ||
workflow_dispatch: | ||
release: | ||
types: [published, edited] | ||
|
||
jobs: | ||
build-and-publish-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
ghcr.io/yamadashy/repomix | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to GitHub Container Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and Publish Docker Image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
push: ${{ github.event_name != 'pull_request' }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
platforms: linux/amd64 | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM node:22-slim | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
git \ | ||
ca-certificates \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN mkdir /repomix | ||
WORKDIR /repomix | ||
|
||
# Install dependencies and build repomix, then link the package to the global scope | ||
# To reduce the size of the layer, npm ci and npm link are executed in the same RUN command | ||
COPY . . | ||
RUN npm ci \ | ||
&& npm run build \ | ||
&& npm link \ | ||
&& npm ci --omit=dev \ | ||
&& npm cache clean --force | ||
|
||
WORKDIR /app | ||
|
||
# Check the operation of repomix | ||
RUN repomix --version | ||
RUN repomix --help | ||
|
||
ENTRYPOINT ["repomix"] |
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