fix: Correctly handle target path in reverse proxy configuration #25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Publish Docker Image | |
on: | |
push: | |
branches: | |
- develop | |
tags: | |
- 'v*' | |
pull_request: | |
branches: | |
- develop | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.23.2' | |
- name: Build | |
run: | | |
CGO_ENABLED=0 GOOS=linux go build \ | |
-ldflags "-X go.lumeweb.com/akash-metrics-registrar/pkg/build.Version=${GITHUB_REF_NAME} \ | |
-X go.lumeweb.com/akash-metrics-registrar/pkg/build.GitCommit=${GITHUB_SHA} \ | |
-X go.lumeweb.com/akash-metrics-registrar/pkg/build.BuildTime=$(date -u '+%Y-%m-%d_%H:%M:%S')" \ | |
-o akash-metrics-registrar ./cmd/metrics-registrar | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=sha | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |