-
Notifications
You must be signed in to change notification settings - Fork 12
56 lines (51 loc) · 2.44 KB
/
pr-merged.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
52
53
54
55
56
name: update docker images
on:
pull_request:
branches:
- master
types:
- closed
paths:
- plugin.yaml
- README-dockerhub.md
jobs:
Update-images:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout target branch
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.base.ref }}
- name: Login to docker.io registry
uses: docker/login-action@v2
with:
username: ${{ secrets.ARGON_DOCKERHUB_USER }}
password: ${{ secrets.ARGON_DOCKERHUB_TOKEN }}
- name: Extract version
run: "echo \"new_version=$(grep 'version: ' plugin.yaml | cut -d '\"' -f2)\" >> $GITHUB_ENV"
- name: Change image versions to latest
run: |
docker pull aquasec/aqua-scanner:${{ env.new_version }}-amd64
docker tag aquasec/aqua-scanner:${{ env.new_version }}-amd64 aquasec/aqua-scanner:latest-amd64
docker push aquasec/aqua-scanner:latest-amd64
docker pull aquasec/aqua-scanner:${{ env.new_version }}-arm64
docker tag aquasec/aqua-scanner:${{ env.new_version }}-arm64 aquasec/aqua-scanner:latest-arm64
docker push aquasec/aqua-scanner:latest-arm64
docker pull aquasec/aqua-scanner:${{ env.new_version }}-amd64-limited
docker tag aquasec/aqua-scanner:${{ env.new_version }}-amd64-limited aquasec/aqua-scanner:latest-amd64-limited
docker push aquasec/aqua-scanner:latest-amd64-limited
docker pull aquasec/aqua-scanner:${{ env.new_version }}-arm64-limited
docker tag aquasec/aqua-scanner:${{ env.new_version }}-arm64-limited aquasec/aqua-scanner:latest-arm64-limited
docker push aquasec/aqua-scanner:latest-arm64-limited
docker manifest create aquasec/aqua-scanner:latest aquasec/aqua-scanner:latest-amd64 aquasec/aqua-scanner:latest-arm64
docker manifest push aquasec/aqua-scanner:latest
docker manifest create aquasec/aqua-scanner:latest-limited aquasec/aqua-scanner:latest-amd64-limited aquasec/aqua-scanner:latest-arm64-limited
docker manifest push aquasec/aqua-scanner:latest-limited
- name: DockerHub description update
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.ARGON_DOCKERHUB_USER }}
password: ${{ secrets.ARGON_DOCKERHUB_TOKEN }}
repository: aquasec/aqua-scanner
readme-filepath: ./README-dockerhub.md