-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (47 loc) · 1.79 KB
/
publish_image_collector.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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