Skip to content

Commit

Permalink
add github action to publish packages and backend apps
Browse files Browse the repository at this point in the history
  • Loading branch information
TBonnin committed Jan 8, 2024
1 parent 725fcab commit 2b4260f
Show file tree
Hide file tree
Showing 15 changed files with 261 additions and 26 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/push-container.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Push container

on:
workflow_call:
inputs:
package:
required: true
run-cmd:
required: true
tags:
required: true

jobs:
build-push-container:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: actions/setup-node@v3
with:
node-version: '18.x'
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push container
run: |
npm run i && npm run ${{ inputs.run-cmd }}
docker buildx build -f packages/${{ inputs.package }}/Dockerfile --platform linux/amd64 ${{ inputs.tags }} . --no-cache --output type=registry
132 changes: 132 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: Nango Release
on: [push, pull_request]
concurrency:
group: pulls/${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
npm-publish:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- name: Publish npm packages
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
shell: bash
run: |
bash ./scripts/publish.sh
#TODO: commit changes to repo
nango-jobs:
uses: ./.github/workflows/push-container.yaml
inputs:
package: jobs
run-cmd: ts-build
tags: -t nangohq/nango-jobs:${{ github.sha }}
# nango-jobs:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: docker/setup-buildx-action@v3
# - uses: actions/setup-node@v3
# with:
# node-version: '18.x'
# - uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}
# - name: Build and push container for nango-jobs
# run: |
# npm run i && npm run ts-build
# docker buildx build -f packages/jobs/Dockerfile --platform linux/amd64 -t nangohq/nango-jobs:$(git rev-parse --short HEAD) . --no-cache --output type=registry
# nango-runner:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: docker/setup-buildx-action@v3
# - uses: actions/setup-node@v3
# with:
# node-version: '18.x'
# - uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}
# - name: Build and push container for nango-runner
# run: |
# npm run i
# npm run ts-build
# docker buildx build -f packages/runner/Dockerfile --platform linux/amd64 -t nangohq/nango-runner:$(git rev-parse --short HEAD) . --no-cache --output type=registry
# nango-server-prod:
# if: github.ref == 'refs/heads/master'
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: docker/setup-buildx-action@v3
# - uses: actions/setup-node@v3
# with:
# node-version: '18.x'
# - uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}
# - name: Build and push container for nango-server (prod)
# run: |
# npm run i
# npm run build:prod
# docker buildx build -f packages/server/Dockerfile --platform linux/amd64 -t nangohq/nango-server:$(git rev-parse --short HEAD) -t nangohq/nango-cloud:production . --no-cache --output type=registry
# nango-server-staging:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: docker/setup-buildx-action@v3
# - uses: actions/setup-node@v3
# with:
# node-version: '18.x'
# - uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}
# - name: Build and push container for nango-server (staging)
# run: |
# npm run i
# npm run build:staging
# docker buildx build -f packages/server/Dockerfile --platform linux/amd64 -t nangohq/nango-server:staging-$(git rev-parse --short HEAD) . --no-cache --output type=registry
# nango-server-self-hosted:
# if: github.ref == 'refs/heads/master'
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: docker/setup-buildx-action@v3
# - uses: actions/setup-node@v3
# with:
# node-version: '18.x'
# - uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}
# - name: Build and push container for nango-server (self-hosted)
# run: |
# npm run i
# npm run build:hosted
# docker buildx build --platform linux/amd64 -f packages/server/Dockerfile -t nangohq/nango-server:hosted -t nangohq/nango-server:hosted-$(git rev-parse --short HEAD) . --no-cache --output type=registry
# nango-server-enterprise:
# if: github.ref == 'refs/heads/master'
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: docker/setup-buildx-action@v3
# - uses: actions/setup-node@v3
# with:
# node-version: '18.x'
# - uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}
# - name: Build and push containers for nango-server (self-hosted)
# run: |
# npm run i
# npm run build:enterprise
# docker buildx build --platform linux/amd64 -f packages/server/Dockerfile -t nangohq/nango-server:enterprise -t nangohq/nango-server:enterprise-$(git rev-parse --short HEAD) . --no-cache --output type=registry
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.36.74
23 changes: 20 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/cli/docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ services:
- nango

nango-server:
image: nangohq/nango-server:0.36.77
image: nangohq/nango-server:production
container_name: nango-server
environment:
- TEMPORAL_ADDRESS=temporal:7233
Expand Down
18 changes: 10 additions & 8 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,23 @@
"description": "Nango's CLI tool.",
"type": "module",
"main": "dist/index.js",
"bin": "./dist/index.js",
"bin": {
"nango": "dist/index.js"
},
"types": "dist/nango-sync.d.ts",
"keywords": [],
"author": "bastien@nango.dev",
"repository": {
"type": "git",
"url": "https://github.com/NangoHQ/nango",
"url": "git+https://github.com/NangoHQ/nango.git",
"directory": "packages/cli"
},
"license": "SEE LICENSE IN LICENSE FILE IN GIT REPOSITORY",
"scripts": {
"build": "tsc",
"build": "tsc && npm run copyfiles",
"copyfiles": "copyfiles -u 1 lib/templates/* dist",
"postbuild": "npm run copyfiles",
"dev": "npm run copyfiles && tsc -w"
"dev": "npm run copyfiles && tsc -w",
"prepublishOnly": "npm install && npm run build"
},
"dependencies": {
"@babel/traverse": "^7.22.5",
Expand All @@ -34,16 +36,13 @@
"copyfiles": "^2.4.1",
"dotenv": "^16.0.3",
"ejs": "^3.1.9",
"esbuild": "^0.17.19",
"figlet": "^1.6.0",
"js-yaml": "^4.1.0",
"memfs": "^3.5.1",
"npm-package-arg": "^10.1.0",
"ora": "^6.3.1",
"promptly": "^3.2.0",
"semver": "^7.5.2",
"ts-node": "^10.9.1",
"typescript": "^5.0.4",
"vm": "^0.1.0"
},
"devDependencies": {
Expand All @@ -60,6 +59,9 @@
"@types/npm-package-arg": "^6.1.1",
"@types/promptly": "^3.0.2",
"babel-loader": "^9.1.2",
"esbuild": "^0.17.19",
"ts-node": "^10.9.1",
"typescript": "^5.0.4",
"webpack": "^5.85.1",
"webpack-cli": "^5.1.3",
"webpack-node-externals": "^3.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
},
"references": [{ "path": "../shared" }],
"include": ["lib/**/*"]
}
}
Loading

0 comments on commit 2b4260f

Please sign in to comment.