Skip to content

chore: adds release action. #4

chore: adds release action.

chore: adds release action. #4

Workflow file for this run

name: CI
on:
pull_request:
branches:
- "main"
paths:
- ".github/workflows/release.yaml"
workflow_dispatch:
inputs:
branch:
description: 'Branch to run the workflow on'
required: true
default: 'main'
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.22.1
- name: Build
run: make build
- 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
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: push
uses: docker/build-push-action@v5
with:
context: extauthz
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: openfga/openfga-envoy:${{ github.event.inputs.branch || 'dev' }}
- name: Write summary
if: ${{ github.event_name != 'pull_request' }}
run: |
echo "The image is available:" >> $GITHUB_STEP_SUMMARY
echo "```" >> $GITHUB_STEP_SUMMARY
echo "docker pull ghcr.io/openfga/openfga-envoy:${{ github.event.inputs.branch }}@${{ steps.push.outputs.digest }}" >> $GITHUB_STEP_SUMMARY
echo "```" >> $GITHUB_STEP_SUMMARY