Skip to content

Rework action workflows #16

Rework action workflows

Rework action workflows #16

Workflow file for this run

name: Deployment to Kubernetes
on:
push:
branches:
- main
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ env.REGISTRY }}/${{ github.repository }}

Check failure on line 11 in .github/workflows/kubernetes.yml

View workflow run for this annotation

GitHub Actions / Deployment to Kubernetes

Invalid workflow file

The workflow is not valid. .github/workflows/kubernetes.yml (Line: 11, Col: 15): Unrecognized named-value: 'env'. Located at position 1 within expression: env.REGISTRY
KUBERNETES_NAMESPACE: default
jobs:
container-image-build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push the container image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ env.IMAGE_NAME }}:${{ github.ref_name }}
deployment-to-kubernetes:
runs-on: arc-runner-set
needs: container-image-build
container:
image: alpine/k8s:1.28.7
permissions:
contents: read
steps:
- name: Deployment to Kubernetes
run: |
git clone https://${{ github.actor }}:${{ github.token }}@github.com/${{ github.repository }}.git
cd ${{ github.event.repository.name }}
helm upgrade --install ${{ github.event.repository.name }} kubernetes \
--namespace ${{ env.KUBERNETES_NAMESPACE }} \
--set image.repository=${{ env.IMAGE_NAME }} \
--set image.tag=${{ github.ref_name }} \
--set imagePullSecrets[0]=ghcr \
--set ports[0].containerPort=8080 \
--set service.containerPort=8080