ci db-migrations
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
name: Deploy db-migrations
|
||||
run-name: ${{ github.actor }} deployed to build branch
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'services/db-migrate/**'
|
||||
- '.gitea/workflows/deploy-db-migrate.yaml'
|
||||
|
||||
jobs:
|
||||
db-migrations:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '22'
|
||||
|
||||
- name: install dependencies
|
||||
run: |
|
||||
corepack enable pnpm && corepack use pnpm@8.15.9
|
||||
pnpm --filter ./services/db-migrations deploy --prod build/service-db-migrations
|
||||
|
||||
- name: build docker image
|
||||
run: docker build --file services/db-migrations/Dockerfile -t hereconnect/service-db-migrations:${{env.GITHUB_SHA}} build/service-db-migrations
|
||||
|
||||
- name: start container
|
||||
run: DB_MIGRATIONS_TAG=${{env.GITHUB_SHA}} API_URL='http://${{secrets.COUCHDB_USER}}:${{secrets.COUCHDB_PASSWORD}}@127.0.0.1:15984' docker compose -p hereconnect up -d --pull never db-migrations
|
||||
|
||||
- name: cleanup docker image
|
||||
if: always()
|
||||
run: docker rmi hereconnect/service-db-migrations:${{env.GITHUB_SHA}}
|
||||
Reference in New Issue
Block a user