diff --git a/.github/workflows/development_dynamic_enviroment.yml b/.github/workflows/development_dynamic_enviroment.yml index ad867f5..2a39883 100644 --- a/.github/workflows/development_dynamic_enviroment.yml +++ b/.github/workflows/development_dynamic_enviroment.yml @@ -7,33 +7,59 @@ on: branches: ["development"] jobs: + checkout: + runs-on: arc-runner-set + + steps: + - uses: actions/checkout@v4 + + install: + runs-on: arc-runner-set + needs: ["checkout"] + + steps: + - uses: actions/setup-node@v3 + with: + node-version: 18 + - run: npm ci + + fmt: + runs-on: arc-runner-set + needs: ["install"] + + steps: + - run: npm run fmt.check + + lint: + runs-on: arc-runner-set + needs: ["install"] + + steps: + - run: npm run lint + build: - strategy: - matrix: - runner: [arc-runner-set] + runs-on: arc-runner-set + needs: ["install", "fmt", "lint"] + + steps: + - run: npm run build - runs-on: ${{ matrix.runner }} - container: docker.io/node:lts-slim + kubeconfig: + runs-on: arc-runner-set + needs: ["build"] steps: - - uses: actions/checkout@v4 - - name: install - run: npm ci - - name: fmt - run: npm run fmt.check - - name: lint - run: npm run lint - - name: build - run: npm run build - # - name: update - # run: apt update && apt upgrade -y && apt install -y curl && curl -sSL https://get.docker.com/ | sh && dockerd - # - name: kubeconfig - # env: - # KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }} - # run: | - # mkdir -p $GITHUB_WORKSPACE/.kube - # echo "$KUBE_CONFIG" | base64 --decode > $GITHUB_WORKSPACE/.kube/config - # - name: install skaffold - # run: curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 && install skaffold /usr/local/bin/ - # - name: deploy - # run: skaffold run --kubeconfig "$GITHUB_WORKSPACE/.kube/config" --filename "$GITHUB_WORKSPACE/dev-skaffold.yaml" --default-repo registry.internal.visoft.solutions + - name: Create kubeconfig + env: + KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }} + run: | + mkdir -p $GITHUB_WORKSPACE/.kube + echo "$KUBE_CONFIG" | base64 --decode > $GITHUB_WORKSPACE/.kube/config + + deploy: + runs-on: arc-runner-set + needs: ["kubeconfig"] + + steps: + - name: Deploy to kubernetes + run: skaffold run --kubeconfig "$GITHUB_WORKSPACE/.kube/config" --filename "$GITHUB_WORKSPACE/dev-skaffold.yaml" --default-repo registry.internal.visoft.solutions \ No newline at end of file