Merge pull request #20 from MealCraft/feature/moredeployments

Feature/moredeployments
This commit is contained in:
Jun-te Kim 2025-12-13 21:26:31 +00:00 committed by GitHub
commit 95720b6416
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 29 additions and 35 deletions

View file

@ -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

View file

@ -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