Skip to content

docs: check with axim for openedx org sandboxes #80

docs: check with axim for openedx org sandboxes

docs: check with axim for openedx org sandboxes #80

Workflow file for this run

name: Publish Image and Helm Chart
on:
push:
branches:
- main
tags:
- "v*.*.*"
pull_request: {}
permissions:
contents: read
packages: write
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/open-craft/pr-sandbox-automation
tags: |
type=sha,format=short,prefix=sha-
type=ref,event=tag
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Set chart versions
id: chart
run: |
set -euo pipefail
if [ "${GITHUB_REF_TYPE}" = "tag" ]; then
version="${GITHUB_REF_NAME#v}"
app_version="${GITHUB_REF_NAME#v}"
else
short_sha="$(git rev-parse --short=8 HEAD)"
version="0.1.0-sha.${short_sha}"
app_version="sha-${short_sha}"
fi
echo "version=${version}" >> "${GITHUB_OUTPUT}"
echo "app_version=${app_version}" >> "${GITHUB_OUTPUT}"
- name: Set up Helm
uses: azure/setup-helm@v4
- name: Helm dependency update
run: helm dependency update charts/pr-sandbox-automation
- name: Helm lint
run: helm lint charts/pr-sandbox-automation
- name: Helm package
if: github.event_name != 'pull_request'
run: |
helm package charts/pr-sandbox-automation \
--version "${{ steps.chart.outputs.version }}" \
--app-version "${{ steps.chart.outputs.app_version }}"
- name: Helm registry login
if: github.event_name != 'pull_request'
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io \
-u "${{ github.actor }}" --password-stdin
- name: Helm push
if: github.event_name != 'pull_request'
run: |
helm push "pr-sandbox-automation-${{ steps.chart.outputs.version }}.tgz" \
oci://ghcr.io/open-craft/charts