-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (62 loc) · 2.07 KB
/
Copy pathupdate-stack.yml
File metadata and controls
72 lines (62 loc) · 2.07 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
---
name: Update Stack Images
on: # yamllint disable-line rule:truthy
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y curl jq yq
- name: Close existing PR
env:
GH_TOKEN: ${{ github.token }}
run: |
PR_NUMBER=$(gh pr list --head update-stack-images --json number --jq '.[0].number')
if [ -n "$PR_NUMBER" ]; then
gh pr close $PR_NUMBER --comment "Closing to create a new updated PR."
git push origin --delete update-stack-images || true
fi
- name: Check for image updates
id: check
run: |
chmod +x .github/scripts/update-stack.sh
if .github/scripts/update-stack.sh > /tmp/check-output.json; then
echo "updates_available=true" >> $GITHUB_OUTPUT
else
echo "updates_available=false" >> $GITHUB_OUTPUT
fi
cat /tmp/check-output.json
- name: Apply updates
if: steps.check.outputs.updates_available == 'true'
run: |
.github/scripts/update-stack.sh -w
- name: Create Pull Request
if: steps.check.outputs.updates_available == 'true'
uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.PAT_TOKEN }}
commit-message: "chore: bump service versions"
title: "chore: update stack Docker images"
body: |
Automated update of Docker image versions in the stack.
This PR updates the following images to their latest versions:
- Grafana
- Loki
- Traefik
- Alloy
- Mimir
- Pyroscope
Please review the changes before merging.
branch: update-stack-images
delete-branch: true
labels: dependencies,docker