|
| 1 | +name: Publish (containers) |
| 2 | + |
| 3 | +permissions: |
| 4 | + contents: read |
| 5 | + |
| 6 | +on: |
| 7 | + workflow_call: |
| 8 | + secrets: |
| 9 | + dockerhub-password: |
| 10 | + dockerhub-username: |
| 11 | + inputs: |
| 12 | + dev: |
| 13 | + required: true |
| 14 | + type: boolean |
| 15 | + default: true |
| 16 | + dockerhub-repo: |
| 17 | + required: true |
| 18 | + default: envoy |
| 19 | + type: string |
| 20 | + sha: |
| 21 | + required: true |
| 22 | + type: string |
| 23 | + target-branch: |
| 24 | + required: true |
| 25 | + type: string |
| 26 | + trusted: |
| 27 | + required: true |
| 28 | + type: boolean |
| 29 | + version-major: |
| 30 | + required: false |
| 31 | + type: number |
| 32 | + version-minor: |
| 33 | + required: false |
| 34 | + type: number |
| 35 | + version-patch: |
| 36 | + required: false |
| 37 | + type: number |
| 38 | + |
| 39 | +concurrency: |
| 40 | + group: >- |
| 41 | + ${{ github.actor != 'trigger-release-envoy[bot]' |
| 42 | + && github.event.inputs.head_ref |
| 43 | + || github.run_id |
| 44 | + }}-${{ github.event.workflow.id }}-publish-release-container |
| 45 | + cancel-in-progress: true |
| 46 | + |
| 47 | + |
| 48 | +jobs: |
| 49 | + push-manifests: |
| 50 | + name: Create manifests (${{ inputs.trustred && 'dry run' || 'push' }}) |
| 51 | + runs-on: ubuntu-22.04 |
| 52 | + permissions: |
| 53 | + contents: read |
| 54 | + packages: read |
| 55 | + steps: |
| 56 | + - name: Generate manifest configuration (dev) |
| 57 | + id: dev-config |
| 58 | + if: ${{ inputs.dev && inputs.target-branch == 'main' }} |
| 59 | + uses: envoyproxy/toolshed/gh-actions/[email protected] |
| 60 | + with: |
| 61 | + input-format: yaml |
| 62 | + filter: >- |
| 63 | + {manifests: .} |
| 64 | + input: | |
| 65 | + - name: ${{ inputs.dockerhub-repo }} |
| 66 | + tag: dev |
| 67 | + registry: docker.io/envoyproxy |
| 68 | + architectures: |
| 69 | + - amd64 |
| 70 | + - arm64 |
| 71 | + artifact-pattern: envoy.{arch}.tar |
| 72 | + additional-tags: |
| 73 | + - dev-${{ github.sha }} |
| 74 | + - name: ${{ inputs.dockerhub-repo }} |
| 75 | + tag: contrib-dev |
| 76 | + registry: docker.io/envoyproxy |
| 77 | + architectures: |
| 78 | + - amd64 |
| 79 | + - arm64 |
| 80 | + artifact-pattern: envoy-contrib.{arch}.tar |
| 81 | + additional-tags: |
| 82 | + - contrib-dev-${{ github.sha }} |
| 83 | + - name: ${{ inputs.dockerhub-repo }} |
| 84 | + tag: contrib-debug-dev |
| 85 | + registry: docker.io/envoyproxy |
| 86 | + architectures: |
| 87 | + - amd64 |
| 88 | + - arm64 |
| 89 | + artifact-pattern: envoy-contrib-debug.{arch}.tar |
| 90 | + additional-tags: |
| 91 | + - contrib-debug-dev-${{ github.sha }} |
| 92 | + - name: ${{ inputs.dockerhub-repo }} |
| 93 | + tag: distroless-dev |
| 94 | + registry: docker.io/envoyproxy |
| 95 | + architectures: |
| 96 | + - amd64 |
| 97 | + - arm64 |
| 98 | + artifact-pattern: envoy-distroless.{arch}.tar |
| 99 | + additional-tags: |
| 100 | + - distroless-dev-${{ github.sha }} |
| 101 | + - name: ${{ inputs.dockerhub-repo }} |
| 102 | + tag: google-vrp-dev |
| 103 | + registry: docker.io/envoyproxy |
| 104 | + architectures: |
| 105 | + - amd64 |
| 106 | + artifact-pattern: envoy-google-vrp.{arch}.tar |
| 107 | + additional-tags: |
| 108 | + - google-vrp-dev-${{ github.sha }} |
| 109 | + - name: ${{ inputs.dockerhub-repo }} |
| 110 | + tag: tools-dev |
| 111 | + registry: docker.io/envoyproxy |
| 112 | + architectures: |
| 113 | + - amd64 |
| 114 | + - arm64 |
| 115 | + artifact-pattern: envoy-tools.{arch}.tar |
| 116 | + additional-tags: |
| 117 | + - tools-dev-${{ github.sha }} |
| 118 | +
|
| 119 | + - name: Generate manifest configuration (release) |
| 120 | + uses: envoyproxy/toolshed/gh-actions/[email protected] |
| 121 | + id: release-config |
| 122 | + if: ${{ ! inputs.dev || ! inputs.target-branch != 'main' }} |
| 123 | + with: |
| 124 | + input-format: yaml |
| 125 | + filter: >- |
| 126 | + {manifests: .} |
| 127 | + input: | |
| 128 | + - name: ${{ inputs.dockerhub-repo }} |
| 129 | + tag: v${{ inputs.version-major }}.${{ inputs.version-minor }}.${{ inputs.version-patch }} |
| 130 | + registry: docker.io/envoyproxy |
| 131 | + architectures: |
| 132 | + - amd64 |
| 133 | + - arm64 |
| 134 | + artifact-pattern: envoy.{arch}.tar |
| 135 | + additional-tags: |
| 136 | + - v${{ inputs.version-major }}.${{ inputs.version-minor }}-latest |
| 137 | + - name: ${{ inputs.dockerhub-repo }} |
| 138 | + tag: contrib-v${{ inputs.version-major }}.${{ inputs.version-minor }}.${{ inputs.version-patch }} |
| 139 | + registry: docker.io/envoyproxy |
| 140 | + architectures: |
| 141 | + - amd64 |
| 142 | + - arm64 |
| 143 | + artifact-pattern: envoy-contrib.{arch}.tar |
| 144 | + additional-tags: |
| 145 | + - contrib-v${{ inputs.version-major }}.${{ inputs.version-minor }}-latest |
| 146 | + - name: ${{ inputs.dockerhub-repo }} |
| 147 | + tag: contrib-debug-v${{ inputs.version-major }}.${{ inputs.version-minor }}.${{ inputs.version-patch }} |
| 148 | + registry: docker.io/envoyproxy |
| 149 | + architectures: |
| 150 | + - amd64 |
| 151 | + - arm64 |
| 152 | + artifact-pattern: envoy-contrib-debug.{arch}.tar |
| 153 | + additional-tags: |
| 154 | + - contrib-debug-v${{ inputs.version-major }}.${{ inputs.version-minor }}-latest |
| 155 | + - name: ${{ inputs.dockerhub-repo }} |
| 156 | + tag: distroless-v${{ inputs.version-major }}.${{ inputs.version-minor }}.${{ inputs.version-patch }} |
| 157 | + registry: docker.io/envoyproxy |
| 158 | + architectures: |
| 159 | + - amd64 |
| 160 | + - arm64 |
| 161 | + artifact-pattern: envoy-distroless.{arch}.tar |
| 162 | + additional-tags: |
| 163 | + - distroless-v${{ inputs.version-major }}.${{ inputs.version-minor }}-latest |
| 164 | + - name: ${{ inputs.dockerhub-repo }} |
| 165 | + tag: google-vrp-v${{ inputs.version-major }}.${{ inputs.version-minor }}.${{ inputs.version-patch }} |
| 166 | + registry: docker.io/envoyproxy |
| 167 | + architectures: |
| 168 | + - amd64 |
| 169 | + artifact-pattern: envoy-google-vrp.{arch}.tar |
| 170 | + additional-tags: |
| 171 | + - google-vrp-v${{ inputs.version-major }}.${{ inputs.version-minor }}-latest |
| 172 | + - name: ${{ inputs.dockerhub-repo }} |
| 173 | + tag: tools-v${{ inputs.version-major }}.${{ inputs.version-minor }}.${{ inputs.version-patch }} |
| 174 | + registry: docker.io/envoyproxy |
| 175 | + architectures: |
| 176 | + - amd64 |
| 177 | + - arm64 |
| 178 | + artifact-pattern: envoy-tools.{arch}.tar |
| 179 | + additional-tags: |
| 180 | + - tools-v${{ inputs.version-major }}.${{ inputs.version-minor }}-latest |
| 181 | +
|
| 182 | + - name: Collect and push OCI artifacts |
| 183 | + uses: envoyproxy/toolshed/gh-actions/oci/collector@555132e7108208a8a610af6e03c38c97c204119d |
| 184 | + with: |
| 185 | + artifacts-pattern: oci.* |
| 186 | + manifest-config: ${{ steps.dev-config.outputs.value || steps.release-config.outputs.value }} |
| 187 | + dry-run: ${{ ! inputs.trusted || (inputs.target-branch != 'main' && inputs.dev) }} |
| 188 | + dockerhub-username: ${{ inputs.trusted && secrets.dockerhub-username || '' }} |
| 189 | + dockerhub-password: ${{ inputs.trusted && secrets.dockerhub-password || '' }} |
0 commit comments