Merge pull request #20 from MealCraft/feature/moredeployments
Feature/moredeployments
This commit is contained in:
commit
95720b6416
2 changed files with 29 additions and 35 deletions
35
.github/workflows/atlas-migratie-dev.yml
vendored
35
.github/workflows/atlas-migratie-dev.yml
vendored
|
|
@ -1,35 +0,0 @@
|
|||
name: Atlas Migrate (dev)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
migrate:
|
||||
runs-on: mealcraft-runners
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Install Atlas
|
||||
- name: Install Atlas CLI
|
||||
run: |
|
||||
curl -sSf https://atlasgo.sh | sh
|
||||
|
||||
# Load DB creds from Kubernetes secret
|
||||
- name: Load Postgres credentials
|
||||
run: |
|
||||
export POSTGRES_USER=$(kubectl get secret postgres-secret -o jsonpath='{.data.POSTGRES_USER}' | base64 -d)
|
||||
export POSTGRES_PASSWORD=$(kubectl get secret postgres-secret -o jsonpath='{.data.POSTGRES_PASSWORD}' | base64 -d)
|
||||
|
||||
echo "POSTGRES_USER=$POSTGRES_USER" >> $GITHUB_ENV
|
||||
echo "POSTGRES_PASSWORD=$POSTGRES_PASSWORD" >> $GITHUB_ENV
|
||||
|
||||
# Run Atlas migrations (DEV only)
|
||||
- name: Run Atlas migrations (dev)
|
||||
run: |
|
||||
atlas migrate apply \
|
||||
--env stripe_invoice_dev \
|
||||
--dir file://db/atlas/stripe_invoice/migrations
|
||||
29
.github/workflows/deploy-postgres.yml
vendored
29
.github/workflows/deploy-postgres.yml
vendored
|
|
@ -57,3 +57,32 @@ jobs:
|
|||
- name: Deploy Postgres backups
|
||||
run: |
|
||||
kubectl apply -f db/k8s/backups/
|
||||
|
||||
migrate:
|
||||
runs-on: mealcraft-runners
|
||||
needs: deploy
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Install Atlas
|
||||
- name: Install Atlas CLI
|
||||
run: |
|
||||
curl -sSf https://atlasgo.sh | sh
|
||||
|
||||
# Load DB creds from Kubernetes secret
|
||||
- name: Load Postgres credentials
|
||||
run: |
|
||||
export POSTGRES_USER=$(kubectl get secret postgres-secret -o jsonpath='{.data.POSTGRES_USER}' | base64 -d)
|
||||
export POSTGRES_PASSWORD=$(kubectl get secret postgres-secret -o jsonpath='{.data.POSTGRES_PASSWORD}' | base64 -d)
|
||||
|
||||
echo "POSTGRES_USER=$POSTGRES_USER" >> $GITHUB_ENV
|
||||
echo "POSTGRES_PASSWORD=$POSTGRES_PASSWORD" >> $GITHUB_ENV
|
||||
|
||||
# Run Atlas migrations (DEV only)
|
||||
- name: Run Atlas migrations (dev)
|
||||
run: |
|
||||
atlas migrate apply \
|
||||
--env stripe_invoice_dev
|
||||
|
||||
Loading…
Add table
Reference in a new issue