Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

ci: 👷 ci system to github action #3

ci: 👷 ci system to github action

ci: 👷 ci system to github action #3

Workflow file for this run

name: Deploy to k8s
on:
push:
branches:
- main
- beta
- develop
env:
DO_CLUSTER: ${{ secrets.DO_CLUSTER }}
DOCKER_LOGIN: ${{ secrets.DOCKER_LOGIN }}
DOCKER_PWD: ${{ secrets.DOCKER_PWD }}
jobs:
build:
name: Build website
runs-on: ubuntu-latest
environment:
name:
${{ (github.ref == 'refs/heads/main') && 'production' || (github.ref ==
'refs/heads/develop') && 'test' || (github.ref == 'refs/heads/beta') &&
'beta' }}
env:
ILLA_APP_ENV: ${{ vars.ILLA_APP_ENV }}
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DO_TOKEN }}
- name: Install kubectl
run: |
sudo snap install kubectl --classic
- name: Setup kubectl
run: |
doctl kubernetes cluster kubeconfig save $DO_CLUSTER
kubectl version
- name: Build Docker
run: |
docker build --cache-from=illa-website-frontend -f Dockerfile -t illa-website-frontend .
- name: Push application Docker image
run: |
docker login -u $DOCKER_LOGIN -p $DOCKER_PWD
docker tag illa-website-frontend "illasoft/illa-website-frontend:$GITHUB_REF_NAME"
docker push "illasoft/illa-website-frontend:$GITHUB_REF_NAME"
- uses: actions/checkout@v4
with:
repository: illacloud/k8s-application-do
token: ${{ secrets.ILLA_BOT_TOKEN }}
path: k8s-application-do
- name: Deploy to Kubernetes
run: |

Check failure on line 63 in .github/workflows/build_image.yml

View workflow run for this annotation

GitHub Actions / Deploy to k8s

Invalid workflow file

The workflow is not valid. .github/workflows/build_image.yml (Line: 63, Col: 14): Unrecognized named-value: 'ILLA_APP_ENV'. Located at position 1 within expression: ILLA_APP_ENV
cd k8s-application-do/namespace-${{ ILLA_APP_ENV }}
kubectl delete pod -n ${{ ILLA_APP_ENV }} -l repo=illa-website-frontend
kubectl apply -f ./illa-website-frontend/ -n ${{ ILLA_APP_ENV }}