Skip to content

Commit

Permalink
Update and rename docker-build.yaml to docker-helm.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
max5dt authored Nov 7, 2024
1 parent 77adc7b commit 79e7573
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 36 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/docker-build.yaml

This file was deleted.

79 changes: 79 additions & 0 deletions .github/workflows/docker-helm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Build and Push Docker Image with Buildx and Push Helm Chart

on:
push:
branches:
- main
- dev
tags:
- '*'
pull_request:
branches:
- main
workflow_dispatch:

jobs:
docker:
if: github.event_name != 'pull_request'
runs-on: ${{ vars.RUNNER_SCALE_SET }}
steps:
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: ${{ vars.DOCKER_REGISTRY }}
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ vars.DOCKER_REGISTRY }}/${{ vars.DOCKER_PROJECT }}/${{ vars.DOCKER_IMAGE }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=sha,format=long,prefix=
type=sha,prefix=
charts: |
type=semver,pattern={{version}}
- name: Build and Push Docker image
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
helm:
if: github.ref_type == 'tag'
runs-on: ${{ vars.RUNNER_SCALE_SET }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
tags: |
type=semver,pattern={{version}}
flavor: |
latest=false
- name: Install Helm
uses: azure/[email protected]

- name: Push Helm Chart
uses: appany/[email protected]
with:
name: ${{ vars.DOCKER_IMAGE }}
repository: charts
tag: ${{ steps.meta.outputs.tags }}
path: deploy/chart
registry: ${{ vars.DOCKER_REGISTRY }}
registry_username: ${{ vars.DOCKER_USERNAME }}
registry_password: ${{ secrets.DOCKER_PASSWORD }}

0 comments on commit 79e7573

Please sign in to comment.