-
Notifications
You must be signed in to change notification settings - Fork 23
58 lines (48 loc) · 1.72 KB
/
docker-pull-upload.yaml
File metadata and controls
58 lines (48 loc) · 1.72 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: Download a copy of the image of of main, retag it, and upload
env:
HADOLINT_VERSION: "2.12.0"
on:
workflow_call:
inputs:
image:
description: Image name
required: true
type: string
registry-name:
description: url of the registry <registy-name>
required: true
type: string
secrets:
REGISTRY_USERNAME:
description: The username for the container registry
required: true
REGISTRY_PASSWORD:
description: The password for the container registry
required: true
jobs:
pull-upload:
runs-on: ubuntu-latest
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
- uses: actions/checkout@v4
- name: Free up all available disk space before building
run: ./.github/scripts/cleanup_runner.sh
# Connect to Azure Container registry (ACR)
- uses: azure/docker-login@v1
with:
login-server: ${{ inputs.registry-name }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Pull existing image
id: pull-existing
run: make pull/${{ inputs.image }} REPO=${{ inputs.registry-name }} TAG=v1
- name: Retag existing image
run: make post-build/${{ inputs.image }} REPO=${{ inputs.registry-name }} SOURCE_FULL_IMAGE_NAME=${{ steps.pull-existing.outputs.image_name }}
- name: Push image to registry (default pushes all tags)
run: make push/${{ inputs.image }} REPO=${{ inputs.registry-name }}
# Free up space from build process (containerscan action will run out of space if we don't)
- run: ./.github/scripts/cleanup_runner.sh