Skip to content

chore: fix unsupported subdirectories #1

chore: fix unsupported subdirectories

chore: fix unsupported subdirectories #1

Workflow file for this run

name: CD Prod Deploy
on:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.repository }}-deployment
cancel-in-progress: true
jobs:
FrontendCI:
uses: ./.github/workflows/ci/ci-frontend.yml

Check failure on line 15 in .github/workflows/cd-prod-deploy.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/cd-prod-deploy.yml

Invalid workflow file

invalid value workflow reference: workflows must be defined at the top level of the .github/workflows/ directory
BackendCI:
uses: ./.github/workflows/ci/ci-backend.yml
CreateVersion:
if: github.event_name == 'workflow_dispatch'
needs: [ BackendCI, FrontendCI ]
runs-on: ubuntu-latest
outputs:
new_tag: ${{ steps.tag.outputs.new_tag }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create version tag
uses: anothrNick/[email protected]
id: tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: false
DRY_RUN: true
Dockerize:
strategy:
matrix:
app: [ frontend, backend ]
needs: [ CreateVersion ]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: main
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login Docker Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: ./${{ matrix.app }}
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/${{ github.repository }}/${{ matrix.app }}:${{ needs.CreateVersion.outputs.new_tag }}
cache-from: type=gha,scope=buildkit-${{ matrix.app }}
cache-to: type=gha,mode=max,scope=buildkit-${{ matrix.app }}
Deploy:
needs: [ Dockerize ]
runs-on: ubuntu-latest
environment:
name: prod
url: https://k8splay.xyz
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: main
- name: Save version tag
uses: anothrNick/[email protected]
id: tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: false
DRY_RUN: false
- name: Install Kubectl
uses: Azure/setup-kubectl@v4
- name: Configure Kubectl
env:
K8S_CONFIG: ${{ secrets.K8S_CONFIG }}
run: |
mkdir -p $HOME/.kube
echo "${K8S_CONFIG}" | base64 --decode > $HOME/.kube/config
shell: bash
- name: Install App with Helm
run: |
helm upgrade prod ./.k8s/app \
--namespace prod \
--set ingress.domain=k8splay.xyz \
--set app.image.tag=${{ steps.tag.outputs.new_tag }} \
--set keycloak.realm=production \
--set keycloak.client.secret=${{ secrets.KEYCLOAK_BACKEND_SECRET }} \
--wait \
--atomic \
--timeout 180s
shell: bash