feat: Add CI/CD workflow, update docs, update submodules
This commit is contained in:
@@ -0,0 +1,120 @@
|
||||
name: CI/CD
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main", "master" ]
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
pull_request:
|
||||
branches: [ "main", "master" ]
|
||||
|
||||
jobs:
|
||||
test-sso-manager:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Use Node.js 20.x
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20.x
|
||||
cache: 'npm'
|
||||
cache-dependency-path: sso-manager-node/nodejs/package-lock.json
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: ./sso-manager-node/nodejs
|
||||
run: npm ci || npm install
|
||||
|
||||
- name: Run tests
|
||||
working-directory: ./sso-manager-node/nodejs
|
||||
run: npm test
|
||||
|
||||
test-jump-host:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Use Node.js 20.x
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20.x
|
||||
cache: 'npm'
|
||||
cache-dependency-path: jump-host/nodejs/package-lock.json
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: ./jump-host/nodejs
|
||||
run: npm ci || npm install
|
||||
|
||||
- name: Run tests
|
||||
working-directory: ./jump-host/nodejs
|
||||
run: npm test
|
||||
|
||||
test-proxy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Use Node.js 20.x
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20.x
|
||||
cache: 'npm'
|
||||
cache-dependency-path: proxy/nodejs/package-lock.json
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: ./proxy/nodejs
|
||||
run: npm ci || npm install
|
||||
|
||||
- name: Run tests
|
||||
working-directory: ./proxy/nodejs
|
||||
run: npm test
|
||||
|
||||
build-telemetry-agent:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.21'
|
||||
|
||||
- name: Build Agent
|
||||
working-directory: ./telemetry-agent
|
||||
run: go build -v ./...
|
||||
|
||||
docker-push:
|
||||
needs: [test-sso-manager, test-jump-host, test-proxy, build-telemetry-agent]
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Log in to GitHub Container Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and Push SSO Manager
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: ./sso-manager-node
|
||||
file: ./sso-manager-node/Dockerfile.openldap
|
||||
push: true
|
||||
tags: |
|
||||
ghcr.io/${{ github.repository_owner }}/sso-manager:latest
|
||||
ghcr.io/${{ github.repository_owner }}/sso-manager:${{ github.ref_name }}
|
||||
|
||||
- name: Build and Push Proxy
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: ./proxy
|
||||
file: ./proxy/Dockerfile
|
||||
push: true
|
||||
tags: |
|
||||
ghcr.io/${{ github.repository_owner }}/theta-proxy:latest
|
||||
ghcr.io/${{ github.repository_owner }}/theta-proxy:${{ github.ref_name }}
|
||||
Reference in New Issue
Block a user