dryrun
This commit is contained in:
@@ -26,12 +26,50 @@ jobs:
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
target: runtime
|
||||
tags: |
|
||||
ghcr.io/project-optima/ttscm-api:latest
|
||||
ghcr.io/project-optima/ttscm-api:${{ github.event.release.tag_name }}
|
||||
|
||||
- name: Build and push the migration image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
target: migration
|
||||
tags: |
|
||||
ghcr.io/project-optima/ttscm-api-migrate:latest
|
||||
ghcr.io/project-optima/ttscm-api-migrate:${{ github.event.release.tag_name }}
|
||||
|
||||
migrate:
|
||||
name: Run Migrations
|
||||
needs: [build]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set the Kubernetes context
|
||||
uses: azure/k8s-set-context@v2
|
||||
with:
|
||||
method: kubeconfig
|
||||
kubeconfig: ${{ secrets.KUBECONFIG }}
|
||||
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Delete previous migration job if exists
|
||||
run: kubectl delete job -n optima -l app=prisma-migrate --ignore-not-found
|
||||
|
||||
- name: Apply migration job
|
||||
run: |
|
||||
TAG=${{ github.event.release.tag_name }}
|
||||
sed "s/RELEASE_TAG/${TAG}/g" kubernetes/migration-job.yaml | kubectl apply -f -
|
||||
|
||||
- name: Wait for migration to complete
|
||||
run: |
|
||||
TAG=${{ github.event.release.tag_name }}
|
||||
kubectl wait --for=condition=complete --timeout=120s -n optima job/prisma-migrate-${TAG}
|
||||
|
||||
deploy:
|
||||
name: Deploy
|
||||
needs: [build]
|
||||
needs: [migrate]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set the Kubernetes context
|
||||
|
||||
Reference in New Issue
Block a user