Skip to content

Add Open Telemetry logging signals #21

Add Open Telemetry logging signals

Add Open Telemetry logging signals #21

Workflow file for this run

name: Build and push
on:
pull_request_target:
branches: [ "main" ]
types:
- closed
workflow_dispatch:
permissions:
contents: write
packages: write
jobs:
build:
if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build app image
run: docker build . --tag image
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push app image
id: image
run: |
IMAGE_ID=ghcr.io/eiffel-community/etos-suite-starter
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "main" ] && VERSION=$(echo ${{ github.sha }} | cut -c1-8)
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag image $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
echo $IMAGE_ID:$VERSION
echo "::set-output name=version::$VERSION"
- name: Update manifests
uses: fjogeleit/yaml-update-action@main
with:
valueFile: 'manifests/base/deployment.yaml'
propertyPath: 'spec.template.spec.containers[0].image'
value: ghcr.io/eiffel-community/etos-suite-starter:${{ steps.image.outputs.version }}
branch: main
commitChange: true
message: Updating manifest image to version ${{ steps.image.outputs.version }}