This commit is contained in:
parent
f03513aa99
commit
2ad14d90e0
@ -13,30 +13,18 @@ jobs:
|
|||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: '22'
|
|
||||||
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm ci
|
|
||||||
|
|
||||||
- name: Build Angular app
|
|
||||||
run: npm run build --prod
|
|
||||||
|
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
run: |
|
run: |
|
||||||
docker build -t ${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USER }}/hosting-frontend-prod:${{ github.sha }} .
|
docker build -t ${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USER }}/hosting-backend-prod:${{ github.sha }} .
|
||||||
docker tag ${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USER }}/hosting-frontend-prod:${{ github.sha }} ${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USER }}/hosting-frontend-prod:latest
|
docker tag ${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USER }}/hosting-backend-prod:${{ github.sha }} ${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USER }}/hosting-backend-prod:latest
|
||||||
|
|
||||||
- name: Login to Container Registry
|
- name: Login to Container Registry
|
||||||
run: echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ secrets.REGISTRY_URL }} -u "${{ secrets.REGISTRY_USER }}" --password-stdin
|
run: echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ secrets.REGISTRY_URL }} -u "${{ secrets.REGISTRY_USER }}" --password-stdin
|
||||||
|
|
||||||
- name: Push Docker image
|
- name: Push Docker image
|
||||||
run: |
|
run: |
|
||||||
docker push ${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USER }}/hosting-frontend-prod:${{ github.sha }}
|
docker push ${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USER }}/hosting-backend-prod:${{ github.sha }}
|
||||||
docker push ${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USER }}/hosting-frontend-prod:latest
|
docker push ${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USER }}/hosting-backend-prod:latest
|
||||||
|
|
||||||
- name: Setup kubectl
|
- name: Setup kubectl
|
||||||
uses: azure/setup-kubectl@v3
|
uses: azure/setup-kubectl@v3
|
||||||
@ -61,7 +49,7 @@ jobs:
|
|||||||
- name: Deploy to k3s
|
- name: Deploy to k3s
|
||||||
run: |
|
run: |
|
||||||
kubectl apply -k deploy/k3s/prod --kubeconfig ~/.kube/config
|
kubectl apply -k deploy/k3s/prod --kubeconfig ~/.kube/config
|
||||||
kubectl set image deployment/hosting-frontend \
|
kubectl set image deployment/hosting-backend \
|
||||||
hosting-frontend=${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USER }}/hosting-frontend-prod:${{ github.sha }} \
|
hosting-backend=${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USER }}/hosting-backend-prod:${{ github.sha }} \
|
||||||
-n hosting --kubeconfig ~/.kube/config
|
-n hosting --kubeconfig ~/.kube/config
|
||||||
kubectl rollout status deployment/hosting-frontend -n hosting --kubeconfig ~/.kube/config
|
kubectl rollout status deployment/hosting-backend -n hosting --kubeconfig ~/.kube/config
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user