78 lines
2.1 KiB
YAML
78 lines
2.1 KiB
YAML
name: Publish web image
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
jobs:
|
|
publish:
|
|
name: Build & push web image to GHCR
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: docker/setup-qemu-action@v4
|
|
- uses: docker/setup-buildx-action@v4
|
|
|
|
- uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: ghcr.io/${{ github.repository_owner }}/openconcho-web
|
|
tags: |
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=raw,value=latest
|
|
type=sha,format=short
|
|
|
|
- uses: docker/build-push-action@v7
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
|
|
publish-chart:
|
|
name: Package & push Helm chart to GHCR
|
|
runs-on: ubuntu-latest
|
|
needs: [publish]
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: azure/setup-helm@v4
|
|
|
|
- name: Derive chart version
|
|
id: version
|
|
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Log in to GHCR (Helm OCI)
|
|
run: |
|
|
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io \
|
|
--username "${{ github.actor }}" \
|
|
--password-stdin
|
|
|
|
- name: Package chart
|
|
run: |
|
|
helm package charts/openconcho \
|
|
--version "${{ steps.version.outputs.VERSION }}" \
|
|
--app-version "${{ steps.version.outputs.VERSION }}"
|
|
|
|
- name: Push chart
|
|
run: |
|
|
helm push "openconcho-${{ steps.version.outputs.VERSION }}.tgz" \
|
|
oci://ghcr.io/${{ github.repository_owner }}/charts
|