Skip to content

Prepare v0.0.48

Prepare v0.0.48 #35

Workflow file for this run

name: Docker Image CI
on:
push:
tags:
- "v*.*.*"
env:
IMAGE_NAME: ${{ github.repository }}
REGISTRY: ghcr.io
HELM_PATH_TEST: "./deployment/test"
HELM_PATH_DEMO: "./deployment/demo"
jobs:
buildAndPushImage:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=pr
type=semver,pattern={{version}}
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=pixelaw/core:latest
cache-to: type=inline
outputs:
tags: ${{ steps.build.outputs.tags }}
buildAndPushHelmChart:
needs: buildAndPushImage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: helm lint
run: |
helm lint $HELM_PATH_TEST
- name: helm login
run: |
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io -u $ --password-stdin
- name: helm package
run: |
helm package $HELM_PATH_TEST --version ${{ needs.buildAndPushImage.outputs.tags }}
- name: helm push
if: ${{ github.event_name == 'push' }}
run: |
helm push ${{ env.CHART_NAME }}-${{ needs.buildAndPushImage.outputs.tags }}.tgz oci://ghcr.io/${{ github.repository_owner }}