Skip to content

CD

CD #7

Workflow file for this run

name: CD
on:
workflow_run:
workflows: [CI]
branches: [main]
types:
- completed
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: |
ghcr.io/${{ github.repository }}
- id: build
uses: docker/build-push-action@v5
with:
push: true
load: true
cache-from: type=gha,scope=discordbot
cache-to: type=gha,mode=max,scope=discordbot
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
migrate:
runs-on: ubuntu-latest
env:
PGURL: ${{ secrets.PGURL }}
FORCE_PRETTY_OUTPUT: true
HOST_SECRET: stub value
OAUTH_GITHUB_CLIENT_ID: stub value
OAUTH_GITHUB_SECRET: stub value
SESSION_SECRET: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa any value is fine as long as its 32 chars long"
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '22.x'
- name: cache npm dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-discordbot-npm-cache-${{ hashFiles('service/api/package-lock.json') }}
restore-keys: |
${{ runner.os }}-discordbot-npm-cache-
- name: install deps
run: |
npm ci
- name: migrate
run: |
npm run migrate
xtp:
runs-on: ubuntu-latest
env:
XTP_TOKEN: ${{ secrets.XTP_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: update the schema
run: |
body="$(jq -rcM -n --arg content "$(cat plugin.yaml)" '{"name":"chat", "schema": $content}')"
EXTENSION_ID=ext_01j24z4yc2emetf0hysrnyg41j
curl -sLfi -H "Authorization: Bearer $XTP_TOKEN" 'https://xtp-staging.dylibso.com/api/v1/extension-points/'$EXTENSION_ID