feat: initial landing page with K8s deploy config
- Nginx static serving with APP_URL env var - K8s manifests for prod and staging - Gitea Actions CI/CD pipeline
This commit is contained in:
52
.gitea/workflows/deploy.yml
Normal file
52
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,52 @@
|
||||
name: Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
build-and-push-prod:
|
||||
name: Build & Push (Prod)
|
||||
runs-on: heavy
|
||||
container: git.batida.io/batida/ci-node:latest
|
||||
steps:
|
||||
- uses: https://git.batida.io/batida/actions-checkout@v4
|
||||
- name: Login to registry
|
||||
run: echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login git.batida.io -u "${{ secrets.REGISTRY_USER }}" --password-stdin
|
||||
- name: Build and push
|
||||
run: |
|
||||
docker build \
|
||||
--build-arg APP_URL=https://app.batida.io \
|
||||
-t git.batida.io/batida/batida-landing:${{ github.sha }} \
|
||||
-t git.batida.io/batida/batida-landing:latest \
|
||||
.
|
||||
docker push git.batida.io/batida/batida-landing:${{ github.sha }}
|
||||
docker push git.batida.io/batida/batida-landing:latest
|
||||
|
||||
deploy-staging:
|
||||
name: Deploy Staging
|
||||
runs-on: heavy
|
||||
needs: [build-and-push-prod]
|
||||
container: git.batida.io/batida/ci-node:latest
|
||||
steps:
|
||||
- name: Deploy to staging
|
||||
run: |
|
||||
echo "$KUBECONFIG_CONTENT" > /tmp/kubeconfig
|
||||
kubectl --kubeconfig /tmp/kubeconfig set image deployment/batida-landing batida-landing=git.batida.io/batida/batida-landing:${{ github.sha }} -n staging
|
||||
kubectl --kubeconfig /tmp/kubeconfig rollout status deployment/batida-landing -n staging --timeout=120s
|
||||
env:
|
||||
KUBECONFIG_CONTENT: ${{ secrets.KUBECONFIG }}
|
||||
|
||||
deploy-prod:
|
||||
name: Deploy Prod
|
||||
runs-on: heavy
|
||||
needs: [deploy-staging]
|
||||
container: git.batida.io/batida/ci-node:latest
|
||||
steps:
|
||||
- name: Deploy to prod
|
||||
run: |
|
||||
echo "$KUBECONFIG_CONTENT" > /tmp/kubeconfig
|
||||
kubectl --kubeconfig /tmp/kubeconfig set image deployment/batida-landing batida-landing=git.batida.io/batida/batida-landing:${{ github.sha }} -n prod
|
||||
kubectl --kubeconfig /tmp/kubeconfig rollout status deployment/batida-landing -n prod --timeout=120s
|
||||
env:
|
||||
KUBECONFIG_CONTENT: ${{ secrets.KUBECONFIG }}
|
||||
Reference in New Issue
Block a user