-
Notifications
You must be signed in to change notification settings - Fork 47
79 lines (78 loc) · 3.26 KB
/
push-container-images.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Push container images
on:
workflow_dispatch:
inputs:
version:
description: Full version of container image to push. Normally, this should exactly match the tag name.
required: true
type: string
jobs:
push:
runs-on: ubuntu-latest
name: Push
defaults:
run:
shell: pwsh
steps:
- name: Checkout
uses: actions/[email protected]
- name: Validate build version
id: validate
uses: ./.github/actions/validate-version
with:
version: ${{ inputs.version }}
- name: Log in to GitHub container registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Publish to Docker Hub
run: |
$containers = @('servicecontrol', 'servicecontrol-audit', 'servicecontrol-monitoring', 'servicecontrol-ravendb')
$tags = "${{ steps.validate.outputs.container-tags }}" -Split ','
$sourceTag = "${{ inputs.version }}"
foreach ($tag in $tags)
{
foreach($name in $containers)
{
Write-Output "::group::Pushing $($name):$($tag)"
$cmd = "docker buildx imagetools create --tag particular/$($name):$($tag) ghcr.io/particular/$($name):$($sourceTag)"
Write-Output "Command: $cmd"
Invoke-Expression $cmd
Write-Output "::endgroup::"
}
}
- name: Update Docker Hub Description - ServiceControl
if: ${{ steps.validate.outputs.latest == 'true' }}
uses: peter-evans/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: particular/servicecontrol
readme-filepath: ./src/ServiceControl/Container-README.md
- name: Update Docker Hub Description - Audit
if: ${{ steps.validate.outputs.latest == 'true' }}
uses: peter-evans/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: particular/servicecontrol-audit
readme-filepath: ./src/ServiceControl.Audit/Container-README.md
- name: Update Docker Hub Description - Monitoring
if: ${{ steps.validate.outputs.latest == 'true' }}
uses: peter-evans/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: particular/servicecontrol-monitoring
readme-filepath: ./src/ServiceControl.Monitoring/Container-README.md
- name: Update Docker Hub Description - RavenDB
if: ${{ steps.validate.outputs.latest == 'true' }}
uses: peter-evans/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: particular/servicecontrol-ravendb
readme-filepath: ./src/ServiceControl.RavenDB/Container-README.md