Skip to content

v0.9.0

v0.9.0 #13

Workflow file for this run

name: release
on:
release:
types: [published]
env:
NAME: "git-auth-proxy"
jobs:
helm:
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v4
- name: Install Helm
uses: azure/setup-helm@v4.3.0
- name: Get GitHub Tag
id: get_tag
run: |
echo "::set-output name=tag::${GITHUB_REF#refs/tags/}"
- name: Publish Helm charts
run: |
cd charts
helm registry login -u ${{ github.repository_owner }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io
helm package --app-version ${{ steps.get_tag.outputs.tag }} --version ${{ steps.get_tag.outputs.tag }} git-auth-proxy
helm push git-auth-proxy-${{ steps.get_tag.outputs.tag }}.tgz oci://ghcr.io/xenitab/helm-charts
image:
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v4
- name: Prepare
id: prep
run: |
VERSION=sha-${GITHUB_SHA::8}
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF/refs\/tags\//}
fi
echo ::set-output name=BUILD_DATE::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
echo ::set-output name=VERSION::${VERSION}
- name: Get GitHub Tag
id: get_tag
run: |
echo "::set-output name=tag::${GITHUB_REF#refs/tags/}"
- name: Cache container layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push container (multi arch)
uses: docker/build-push-action@v6
with:
push: true
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
tags: ghcr.io/xenitab/${{ env.NAME }}:${{ steps.get_tag.outputs.tag }}
build-args: |
VERSION=${{ steps.prep.outputs.VERSION }}
REVISION=${{ github.sha }}
CREATED=${{ steps.prep.outputs.BUILD_DATE }}
labels: |
org.opencontainers.image.title=${{ github.event.repository.name }}
org.opencontainers.image.description=${{ github.event.repository.description }}
org.opencontainers.image.url=${{ github.event.repository.html_url }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.version=${{ steps.prep.outputs.VERSION }}
org.opencontainers.image.created=${{ steps.prep.outputs.BUILD_DATE }}
- name: Check images
run: |
docker buildx imagetools inspect ghcr.io/xenitab/${{ env.NAME }}:${{ steps.get_tag.outputs.tag }}
docker pull ghcr.io/xenitab/${{ env.NAME }}:${{ steps.get_tag.outputs.tag }}