Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 39425af43e |
@@ -11,7 +11,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: https://gitea.com/actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
@@ -25,33 +25,44 @@ jobs:
|
|||||||
|
|
||||||
- name: Build and push postgres image
|
- name: Build and push postgres image
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
# if: |
|
if: |
|
||||||
# contains(github.event.commits[0].modified, 'infra/postgres') ||
|
contains(github.event.commits[0].modified, 'infra/docker/postgres-pg-cron') ||
|
||||||
# contains(github.event.commits[0].added, 'infra/postgres')
|
contains(github.event.commits[0].added, 'infra/docker/postgres-pg-cron')
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: infra/postgres/Dockerfile
|
file: infra/docker/postgres-pg-cron/Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USER }}/familyhub-postgres:latest
|
${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USER }}/familyhub-postgres:latest
|
||||||
${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USER }}/familyhub-postgres:${{ github.sha }}
|
cache-from: type=gha
|
||||||
cache-from: type=registry,ref=${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USER }}/familyhub-postgres:cache
|
cache-to: type=gha,mode=max
|
||||||
cache-to: type=registry,ref=${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USER }}/familyhub-postgres:cache,mode=max
|
|
||||||
|
|
||||||
- name: Build and push app image
|
- name: Build and push app image
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: infra/application/Dockerfile
|
file: infra/docker/application/Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USER }}/familyhub:latest
|
${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USER }}/familyhub:latest
|
||||||
${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USER }}/familyhub:${{ github.sha }}
|
${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USER }}/familyhub:${{ github.sha }}
|
||||||
cache-from: type=registry,ref=${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USER }}/familyhub:cache
|
cache-from: type=gha
|
||||||
cache-to: type=registry,ref=${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USER }}/familyhub:cache,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
# - name: Trigger deploy
|
- name: Install kubectl
|
||||||
# run: |
|
run: |
|
||||||
# curl -s -X POST \
|
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
|
||||||
# -H "X-Webhook-Secret: ${{ secrets.WEBHOOK_SECRET }}" \
|
chmod +x kubectl
|
||||||
# "http://10.0.0.2:9001/deploy?container=familyhub"
|
sudo mv kubectl /usr/local/bin/
|
||||||
|
|
||||||
|
- name: Deploy to k3s
|
||||||
|
env:
|
||||||
|
KUBECONFIG_DATA: ${{ secrets.KUBECONFIG }}
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.kube
|
||||||
|
echo "$KUBECONFIG_DATA" > ~/.kube/config
|
||||||
|
chmod 600 ~/.kube/config
|
||||||
|
kubectl rollout restart deployment/application -n family-hub
|
||||||
|
kubectl rollout restart deployment/postgres -n family-hub
|
||||||
|
kubectl rollout status deployment/application -n family-hub --timeout=120s
|
||||||
|
kubectl rollout status deployment/postgres -n family-hub --timeout=120s
|
||||||
|
|||||||
Reference in New Issue
Block a user