Skip to content

Automatic Version Bump (#265) #12

Automatic Version Bump (#265)

Automatic Version Bump (#265) #12

name: Publish Collector
on:
push:
branches: main
paths:
- 'Collector/VERSION'
jobs:
observe:
runs-on: ubuntu-latest
steps:
- uses: plengauer/opentelemetry-bash/actions/instrument/[email protected]
env:
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: 'http://${{ secrets.PARENT_DOMAIN }}:4318/v1/metrics'
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT: 'http://${{ secrets.PARENT_DOMAIN }}:4318/v1/logs'
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: 'http://${{ secrets.PARENT_DOMAIN }}:4318/v1/traces'
diff:
runs-on: ubuntu-latest
outputs:
dirty: ${{ steps.git-diff.outputs.dirty }}
steps:
- uses: plengauer/opentelemetry-bash/actions/instrument/[email protected]
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: git-diff
run: |
echo dirty="$(git diff "$GITHUB_SHA"^1 "$GITHUB_SHA" -- Collector/VERSION | grep -qE "^\+" && echo true || echo false)" >> "$GITHUB_OUTPUT"
publish:
runs-on: ubuntu-latest
needs: diff
if: needs.diff.outputs.dirty == 'true'
steps:
- uses: plengauer/opentelemetry-bash/actions/instrument/[email protected]
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- run: echo "version=$(cat ./DiscordGateway2HTTPMaster/VERSION)" >> "$GITHUB_OUTPUT"
id: version
- uses: docker/build-push-action@v6
with:
context: ./Collector/
tags: ${{ secrets.DOCKERHUB_USERNAME }}/philbot-selfmonitoring:v${{ steps.version.outputs.version }}, ${{ secrets.DOCKERHUB_USERNAME }}/philbot-selfmonitoring:latest
push: true