Skip to content

refactor(main): when generating resources, sort the data of the endpo… #34

refactor(main): when generating resources, sort the data of the endpo…

refactor(main): when generating resources, sort the data of the endpo… #34

Workflow file for this run

name: Release
on:
push:
branches-ignore:
- '**'
tags:
- '*'
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Set up Go
uses: actions/setup-go@master
with:
go-version: 1.20.x
- name: Prepare
id: prepare
run: |
TAG=${GITHUB_REF#refs/tags/}
echo ::set-output name=tag_name::${TAG}
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.8.1
- name: Helm package
run: |
latest_release=${{ steps.prepare.outputs.tag_name }}
sed -i "s#latest#${latest_release}#g" config/charts/endpoints-operator/values.yaml
sed -i "s#0.0.0#${latest_release#v}#g" config/charts/endpoints-operator/Chart.yaml
helm package config/charts/endpoints-operator
git checkout .
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist --timeout=1h
env:
VERSION: ${{ steps.prepare.outputs.tag_name }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: set up buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build (and publish) main image
env:
# fork friendly ^^
DOCKER_REPO: ghcr.io/${{ github.repository_owner }}/endpoints-operator
run: |
docker buildx build \
--platform linux/amd64,linux/arm64 \
--build-arg VERSION=${{ steps.prepare.outputs.tag_name }} \
--push \
-t ${DOCKER_REPO}:${{ steps.prepare.outputs.tag_name }} \
-f dockerfiles/endpoints-operator/Dockerfile \
.
docker buildx build \
--platform linux/amd64,linux/arm64 \
--build-arg VERSION=latest \
--push \
-t ${DOCKER_REPO}:latest \
-f dockerfiles/endpoints-operator/Dockerfile \
.
- name: build (and publish) cepctl image
env:
# fork friendly ^^
DOCKER_REPO: ghcr.io/${{ github.repository_owner }}/cepctl
run: |
docker buildx build \
--platform linux/amd64,linux/arm64 \
--build-arg VERSION=${{ steps.prepare.outputs.tag_name }} \
--push \
-t ${DOCKER_REPO}:${{ steps.prepare.outputs.tag_name }} \
-f dockerfiles/cepctl/Dockerfile \
.
docker buildx build \
--platform linux/amd64,linux/arm64 \
--build-arg VERSION=latest \
--push \
-t ${DOCKER_REPO}:latest \
-f dockerfiles/cepctl/Dockerfile \
.
trigger-workflow-build-helm-chart:
needs: [ goreleaser ]
runs-on: ubuntu-latest
steps:
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Trigger cluster image workflow
uses: peter-evans/repository-dispatch@v2
with:
event-type: release_success
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "version": "${{ env.RELEASE_VERSION }}"}'