Skip to content

Commit

Permalink
fix: decouple as monorepo + action wip
Browse files Browse the repository at this point in the history
  • Loading branch information
devthejo committed Dec 16, 2024
1 parent 5f8130e commit 9e1141b
Show file tree
Hide file tree
Showing 12 changed files with 27,752 additions and 52 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/.yarn/** linguist-vendored
/.yarn/releases/* binary
/.yarn/plugins/**/* binary

# Generated JavaScript files
packages/action/dist/index.js linguist-generated=true -diff export-ignore
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
FROM node:22-alpine AS build
FROM node:20-alpine AS build

USER 1000
WORKDIR /app
ENV NODE_ENV=production

COPY --chown=1000:1000 yarn.lock .yarnrc.yml ./
COPY --chown=1000:1000 .yarn .yarn
RUN yarn fetch workspaces focus --production && yarn cache clean
RUN yarn fetch workspaces focus token-bureau-server --production && yarn cache clean

COPY server ./server
COPY packages/server ./packages/server
COPY package.json ./

EXPOSE 3000
CMD ["yarn", "start"]
CMD ["yarn", "workspace", "token-bureau-server", "start"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ yarn start
To run the server in development mode with auto-reload:

```bash
yarn dev
yarn workspace token-bureau-server dev
```

## License
Expand Down
18 changes: 6 additions & 12 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,15 @@ inputs:
outputs:
token:
description: 'The generated GitHub App token'
value: ${{ steps.main.outputs.token }}
expires_at:
description: 'Token expiration timestamp'
value: ${{ steps.main.outputs.expires_at }}
installation_id:
description: 'GitHub App installation ID'
value: ${{ steps.main.outputs.installation_id }}

runs:
using: 'composite'
steps:
- shell: bash
run: |
npm install -g yarn
yarn
- id: main
shell: node20
run: action.js
using: 'node20'
main: 'dist/index.js'

branding:
icon: 'lock'
color: 'blue'
35 changes: 18 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
{
"name": "@socialgouv/token-bureau",
"name": "~token-bureau-dev",
"version": "0.0.1",
"private": true,
"license": "MIT",
"description": "External endpoint for generating GitHub App tokens with OIDC verification",
"type": "module",
"scripts": {
"start": "node server",
"dev": "nodemon server",
"release": "commit-and-tag-version"
},
"dependencies": {
"@actions/core": "^1.11.1",
"@octokit/auth-app": "^7.1.3",
"@octokit/request": "^9.1.3",
"dotenv": "^16.4.7",
"express": "^5.0.0-beta.2",
"jsonwebtoken": "^9.0.2",
"jwks-rsa": "^3.1.0",
"p-retry": "^6.2.1"
},
"workspaces": [
"packages/*"
],
"devDependencies": {
"commit-and-tag-version": "^12.5.0",
"nodemon": "^3.1.9"
Expand All @@ -28,9 +19,19 @@
"node": ">=20.0.0"
},
"commit-and-tag-version": {
"bumpFiles": [{
"filename": "package.json",
"type": "json"
}]
"bumpFiles": [
{
"filename": "package.json",
"type": "json"
},
{
"filename": "packages/server/package.json",
"type": "json"
},
{
"filename": "packages/action/package.json",
"type": "json"
}
]
}
}
Loading

0 comments on commit 9e1141b

Please sign in to comment.