Some checks failed
Build White Nights admin stage / build-and-deploy (push) Failing after 14s
58 lines
2.1 KiB
YAML
58 lines
2.1 KiB
YAML
name: Build White Nights admin stage
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- feature/stage-service-endpoints
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set image metadata
|
|
id: meta
|
|
run: |
|
|
IMAGE_PREFIX="${{ secrets.REGISTRY_URL }}/krbl/whitenightsadminpanel"
|
|
echo "IMAGE_PREFIX=${IMAGE_PREFIX}" >> "$GITEA_OUTPUT"
|
|
echo "IMAGE_TAG=$(echo \"${{ gitea.sha }}\" | cut -c1-7)" >> "$GITEA_OUTPUT"
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to the container registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ secrets.REGISTRY_URL }}
|
|
username: ${{ secrets.REGISTRY_USER }}
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
- name: Build and push admin panel
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
push: true
|
|
build-args: |
|
|
VITE_API_URL=https://server.white-nights-stage.makkah.verstack.ru
|
|
VITE_KRBL_MEDIA=https://server.white-nights-stage.makkah.verstack.ru/media/
|
|
VITE_GEO_API_URL=https://device.white-nights-stage.makkah.verstack.ru
|
|
VITE_WEATHER_API_URL=https://device.white-nights-stage.makkah.verstack.ru
|
|
tags: |
|
|
${{ steps.meta.outputs.IMAGE_PREFIX }}/service-admin-panel:${{ steps.meta.outputs.IMAGE_TAG }}
|
|
${{ steps.meta.outputs.IMAGE_PREFIX }}/service-admin-panel:stage
|
|
|
|
- name: Restart backend pod to pick up the stage frontend
|
|
env:
|
|
KUBE_CONFIG_DATA: ${{ secrets.WNS_KUBE_CONFIG }}
|
|
run: |
|
|
set -eu
|
|
KUBECONFIG_PATH="$RUNNER_TEMP/wn-kubeconfig"
|
|
printf '%s' "$KUBE_CONFIG_DATA" > "$KUBECONFIG_PATH"
|
|
chmod 600 "$KUBECONFIG_PATH"
|
|
export KUBECONFIG="$KUBECONFIG_PATH"
|
|
kubectl -n white-nights-stage rollout restart deployment/wn-backend
|
|
kubectl -n white-nights-stage rollout status deployment/wn-backend --timeout=5m
|