Skip to content

fix: golang metrics instrumentation (#5) #14

fix: golang metrics instrumentation (#5)

fix: golang metrics instrumentation (#5) #14

Workflow file for this run

name: Containers - distributed-calendar
on:
push:
branches: [ 'main' ]
paths: [ 'dapr-distributed-calendar/**' ]
pull_request:
branches: [ 'main' ]
paths: [ 'dapr-distributed-calendar/**' ]
env:
platforms: linux/amd64
jobs:
build:
strategy:
fail-fast: false
matrix:
container: [ go, node, python ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Prepare tagging
id: prep
run: |
IMAGE_NAME=$(basename ${{ github.repository }})
IMAGE_REPO=${{ github.repository_owner }}
if [[ -n "${{ secrets.IMAGE_NAME }}" ]]; then
IMAGE_NAME="${{ secrets.IMAGE_NAME }}"
fi
if [[ -n "${{ secrets.IMAGE_REPO }}" ]]; then
IMAGE_REPO="${{ secrets.IMAGE_REPO }}"
fi
QUAY_IMAGE="quay.io/$IMAGE_REPO/$IMAGE_NAME-${{ matrix.container }}"
GHCR_IMAGE="ghcr.io/${{ github.repository }}-${{ matrix.container }}"
VERSION="dev"
if [[ '${{ needs.prebuild.outputs.version }}' != '' ]]; then
VERSION="${{ needs.prebuild.outputs.version }}"
fi
if [ "${{ github.event_name }}" = "schedule" ]; then
VERSION="nightly"
fi
TAGS="${QUAY_IMAGE}:${VERSION},${GHCR_IMAGE}:${VERSION}"
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
TAGS="$TAGS,${QUAY_IMAGE}:latest,${GHCR_IMAGE}:latest"
fi
echo "settings tag ${TAGS}"
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: ${{ env.platforms }}
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}-${{ matrix.container }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to Quay
if: ${{ github.ref_name == github.event.repository.default_branch }}
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USER }}
password: ${{ secrets.QUAY_TOKEN }}
- name: Login to GitHub Container Registry
if: ${{ github.ref_name == github.event.repository.default_branch }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.BOT_ACCESS_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
with:
builder: ${{ steps.buildx.outputs.name }}
context: ./dapr-distributed-calendar/${{ matrix.container }}/
push: ${{ github.ref_name == github.event.repository.default_branch }}
tags: ${{ steps.prep.outputs.tags }}
platforms: ${{ env.platforms }}