chore!: Removing teller.io #2310
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
name: GH | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- id: go-cache-paths | |
name: Install pnpm and configure cache | |
run: | | |
npm install -g pnpm | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV | |
echo "GOMODCACHE=$(go env GOMODCACHE)" >> $GITHUB_ENV | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Fix dumb git issue | |
run: | | |
git config --global --add safe.directory ${PWD} | |
- name: Go Build Cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.GOCACHE }} | |
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} | |
- name: Go Mod Cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.GOMODCACHE }} | |
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} | |
${{ runner.os }}-go-mod | |
- name: pnpm Cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
${{ runner.os }}-pnpm-store | |
- name: Build | |
run: | | |
make monetr | |
- uses: actions/upload-artifact@v3 | |
name: Upload UI As Artifact | |
with: | |
name: '${{ github.sha }}-maps' | |
path: '${{ github.workspace }}/server/ui/static' | |
retention-days: 7 | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
env: | |
MONETR_PG_ADDRESS: localhost | |
MONETR_PG_PASSWORD: "" | |
MONETR_PG_USERNAME: api-testing | |
MONETR_PG_DATABASE: test-db | |
services: | |
postgres: | |
image: postgres:15 | |
env: | |
POSTGRES_HOST_AUTH_METHOD: trust | |
POSTGRES_USER: api-testing | |
POSTGRES_DB: test-db | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
# Get values for cache paths to be used in later steps | |
- id: go-cache-paths | |
name: Install pnpm and configure cache | |
run: | | |
npm install -g pnpm | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV | |
echo "GOMODCACHE=$(go env GOMODCACHE)" >> $GITHUB_ENV | |
- uses: actions/checkout@v4 | |
- name: Fix dumb git issue | |
run: | | |
git config --global --add safe.directory ${PWD} | |
# Cache go build cache, used to speedup go test | |
- name: Go Build Cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.GOCACHE }} | |
key: ${{ runner.os }}-test-go-build-${{ hashFiles('**/go.sum', '**/**.go') }} | |
restore-keys: | | |
${{ runner.os }}-test-go-build-${{ hashFiles('**/go.sum', '**/**.go') }} | |
${{ runner.os }}-test-go-build | |
# Cache go mod cache, used to speedup builds | |
- name: Go Mod Cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.GOMODCACHE }} | |
key: ${{ runner.os }}-test-go-mod-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-test-go-mod-${{ hashFiles('**/go.sum') }} | |
${{ runner.os }}-test-go-mod | |
- name: pnpm Cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-test-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-test-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
${{ runner.os }}-test-pnpm-store | |
- name: Test | |
run: | | |
make test | |
- name: CodeCov | |
if: always() | |
uses: codecov/codecov-action@v3 | |
with: | |
name: monetr | |
directory: ${{ github.workspace }}/build/tests | |
root_dir: ${{ github.workspace }} | |
yaml: | |
name: Kubernetes YAMLs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Generate kubernetes yamls | |
run: | | |
git config --global --add safe.directory ${PWD} | |
ENVIRONMENT=my.monetr.dev DEPLOY_VERSION=latest DEPLOY_NAMESPACE=default make generate | |
local_dev: | |
name: Local Development | |
runs-on: ubuntu-latest | |
steps: | |
- id: go-cache-paths | |
name: Install pnpm and configure cache | |
run: | | |
npm install -g pnpm | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV | |
echo "GOMODCACHE=$(go env GOMODCACHE)" >> $GITHUB_ENV | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Fix dumb git issue | |
run: | | |
git config --global --add safe.directory ${PWD} | |
- name: Go Build Cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.GOCACHE }} | |
key: ${{ runner.os }}-localdev-go-build-${{ hashFiles('**/go.sum') }} | |
- name: Go Mod Cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.GOMODCACHE }} | |
key: ${{ runner.os }}-localdev-go-mod-${{ hashFiles('**/go.sum') }} | |
- name: pnpm Cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-localdev-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-localdev-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
${{ runner.os }}-localdev-pnpm-store | |
- name: Setup local development environment | |
timeout-minutes: 10 | |
run: | | |
make develop || (make logs && exit 1) | |
curl -k https://monetr.local | |
make shutdown | |
docs: | |
name: Documentation | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Fix dumb git issue | |
run: | | |
git config --global --add safe.directory ${PWD} | |
- name: Build | |
run: make docs | |
- name: Deploy | |
uses: JamesIves/github-pages-deploy-action@v4.4.3 | |
with: | |
branch: monetr.app | |
folder: docs/out | |
docker: | |
name: Container (Docker) | |
runs-on: ubuntu-latest | |
outputs: | |
post-tag: ${{ steps.tag.outputs.POST_TAG }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Save Tag Variable | |
id: tag | |
run: | | |
echo POST_TAG=$(git describe --tag | cut -d "v" -f 2) >> $GITHUB_OUTPUT | |
- name: Login to containers.monetr.dev | |
uses: docker/login-action@v1 | |
with: | |
registry: containers.monetr.dev | |
username: ${{ secrets.CONTAINERS_MONETR_DEV_USERNAME }} | |
password: ${{ secrets.CONTAINERS_MONETR_DEV_PASSWORD }} | |
- name: Build | |
run: | | |
git config --global --add safe.directory ${PWD} | |
make container-push CONTAINER_REGISTRY=containers.monetr.dev/monetr/monetr CMAKE_OPTIONS=-DBUILD_CONTAINER_TAG_LATEST=OFF RELEASE_VERSION=${{ steps.tag.outputs.POST_TAG }} | |
deploy: | |
needs: | |
- "test" | |
- "docker" | |
name: Deploy my.monetr.dev | |
runs-on: ubuntu-latest | |
steps: | |
- uses: chrnorm/deployment-action@releases/v1 | |
name: Create my.monetr.dev Deployment | |
id: deployment | |
with: | |
initial_status: pending | |
token: "${{ github.token }}" | |
target_url: https://my.monetr.dev | |
environment: my.monetr.dev | |
ref: ${{ github.sha }} | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/download-artifact@v3 | |
name: Download UI As Artifact | |
with: | |
name: '${{ github.sha }}-maps' | |
path: '${{ github.workspace }}/server/ui/static' | |
- name: Create Sentry Release | |
uses: getsentry/action-release@v1 | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
SENTRY_ORG: ${{ secrets.SENTRY_ORG }} | |
SENTRY_PROJECT: monetr | |
with: | |
environment: 'my.monetr.dev' | |
version: 'v${{ needs.docker.outputs.post-tag }}' | |
sourcemaps: 'server/ui/static/assets/scripts' | |
url_prefix: 'https://my.monetr.dev' | |
- name: Trigger Deployment | |
run: | | |
curl -X POST \ | |
--fail \ | |
-F token=${{ secrets.GITLAB_CI_TOKEN }} \ | |
-F "ref=${{ github.head_ref || github.ref_name }}" \ | |
-F "variables[ENVIRONMENT]=my.monetr.dev" \ | |
-F "variables[DEPLOY_VERSION]=${{ needs.docker.outputs.post-tag }}" \ | |
https://gitlab.com/api/v4/projects/46647440/trigger/pipeline |