Repository navigation
58 lines (56 loc) · 2.43 KB
/
Copy pathbump.yml
File metadata and controls
58 lines (56 loc) · 2.43 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
name: Bump packages
on:
repository_dispatch:
types: [bump]
workflow_dispatch:
inputs:
hoprd_version:
description: 'Version of hoprd to build'
required: false
permissions:
contents: read
jobs:
bump:
name: Bump docker images
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- name: Set up Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
- name: Setup variables
id: setup
run: |
default_hoprd_version=$(yq -r '.services.node.build.args.UPSTREAM_VERSION' docker-compose.yml)
default_hoprd_version=$(echo $default_hoprd_version | cut -d@ -f1)
hoprd_version="${HOPRD_VERSION:-$default_hoprd_version}"
docker pull "${DOCKER_REGISTRY}/hoprd:${hoprd_version#v}"
digest=$(docker inspect --format='{{index .RepoDigests 0}}' "${DOCKER_REGISTRY}/hoprd:${hoprd_version#v}" | cut -d@ -f2)
echo "HOPRD_VERSION=${hoprd_version}@${digest}" | tee -a "${GITHUB_OUTPUT}"
env:
DOCKER_REGISTRY: ${{ vars.DOCKER_REGISTRY }}
HOPRD_VERSION: ${{ github.event.inputs.hoprd_version || github.event.client_payload.hoprd_version }}
- name: Update docker-compose.yml
run: |
yq -i '.services.node.build.args.UPSTREAM_VERSION = strenv(HOPRD_VERSION)' docker-compose.yml
env:
DOCKER_REGISTRY: ${{ vars.DOCKER_REGISTRY }}
HOPRD_VERSION: ${{ steps.setup.outputs.HOPRD_VERSION }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
commit-message: "ci: Update docker images"
title: "ci: Update docker images"
body: "This pull request updates the docker images to:\n- hoprd: ${{ steps.setup.outputs.HOPRD_VERSION }}\n\nThis PR was automatically generated by the bump workflow."
branch: bot/update-${{ github.run_id}}
delete-branch: true
assignees: ${{ github.actor }}
labels: publish-ipfs
reviewers: "ausias-armesto,tolbrino,NumberFour8,Teebor-Choka,QYuQianchen,jeandemeusy,Jaguaras"