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 ff89f13
Show file tree
Hide file tree
Showing 17 changed files with 256 additions and 55 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/deploy-runners.yaml

This file was deleted.

56 changes: 56 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Nango Deploy

on:
workflow_dispatch:
inputs:
environment:
type: choice
description: "Environment to deploy to, defaults to staging"
required: true
default: "staging"
options:
- staging
- production
service:
type: choice
description: "Service to deploy, defaults to server"
required: true
default: "server"
options:
- server
- jobs
- runner

jobs:
deploy_server:
if: inputs.service == 'server'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Deploy nango-server
run: |
echo "deploying nangohq/nango-server@${{ github.sha }}"
deploy_jobs:
if: inputs.service == 'jobs'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Deploy nango-jobs
run: |
echo "deploying nangohq/nango-jobs@${{ github.sha }}"
# deploy_runners:
# if: inputs.service == 'runner'
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# - name: Deploy all runners
# env:
# API_KEY: ${{ secrets.RENDER_API_KEY }}
# ENVIRONMENT: ${{ inputs.environment }}
# RUNNER_OWNER_ID: ${{ secrets.RENDER_RUNNER_OWNER_ID }}
# run: |
# bash ./scripts/deploy/runners.bash

34 changes: 34 additions & 0 deletions .github/workflows/push-container.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Push container

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

jobs:
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
67 changes: 67 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
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
secrets: inherit
with:
package: jobs
run-cmd: ts-build
tags: -t nangohq/nango-jobs:${{ github.sha }}
nango-runner:
uses: ./.github/workflows/push-container.yaml
secrets: inherit
with:
package: runner
run-cmd: ts-build
tags: -t nangohq/nango-runner:${{ github.sha }}
nango-server-staging:
uses: ./.github/workflows/push-container.yaml
secrets: inherit
with:
package: server
run-cmd: build:staging
tags: -t nangohq/nango-server:staging-${{ github.sha }}
nango-server-prod:
if: github.ref == 'refs/heads/master'
uses: ./.github/workflows/push-container.yaml
secrets: inherit
with:
package: server
run-cmd: build:prod
tags: -t nangohq/nango-server:production -t nangohq/nango-server:production-${{ github.sha }}
nango-server-self-hosted:
if: github.ref == 'refs/heads/master'
uses: ./.github/workflows/push-container.yaml
secrets: inherit
with:
package: server
run-cmd: build:hosted
tags: -t nangohq/nango-server:hosted -t nangohq/nango-server:hosted-${{ github.sha }}
nango-server-enterprise:
if: github.ref == 'refs/heads/master'
uses: ./.github/workflows/push-container.yaml
secrets: inherit
with:
package: server
run-cmd: build:enterprise
tags: -t nangohq/nango-server:enterprise -t nangohq/nango-server:enterprise-${{ github.sha }}
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
Loading

0 comments on commit ff89f13

Please sign in to comment.