Skip to content

Commit

Permalink
Add branch name to image
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasilii Angapov committed Feb 24, 2024
1 parent fe543b6 commit 8b5f2af
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: container-build
name: Container image build

on:
push:
Expand All @@ -8,10 +8,9 @@ on:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
docker:
container-image-build:
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -25,9 +24,9 @@ jobs:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build
- name: Build and Push the container image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ github.ref_name }}
17 changes: 7 additions & 10 deletions .github/workflows/kubernetes.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deployment to Minikube
name: Deployment to Kubernetes

on:
push:
Expand All @@ -7,26 +7,23 @@ on:
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
NAMESPACE: default
KUBERNETES_NAMESPACE: default

jobs:
deploy-to-kubernetes:
deployment-to-kubernetes:
runs-on: arc-runner-set
container:
image: alpine/k8s:1.28.7
permissions:
contents: read
steps:
- name: Deploy to Minikube
- 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.NAMESPACE }} \
--set image.repository=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} \
--set image.tag=latest \
--namespace ${{ env.KUBERNETES_NAMESPACE }} \
--set image.repository=ghcr.io/${{ github.repository }} \
--set image.tag=${{ github.ref_name }} \
--set imagePullSecrets[0]=ghcr \
--set ports[0].name=http \
--set ports[0].containerPort=8080

0 comments on commit 8b5f2af

Please sign in to comment.