|
| 1 | +# Copyright 2022 The Magma Authors. |
| 2 | +# |
| 3 | +# This source code is licensed under the BSD-style license found in the |
| 4 | +# LICENSE file in the root directory of this source tree. |
| 5 | +# |
| 6 | +# Unless required by applicable law or agreed to in writing, software |
| 7 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 8 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 9 | +# See the License for the specific language governing permissions and |
| 10 | +# limitations under the License. |
| 11 | + |
| 12 | +name: docker promote |
| 13 | + |
| 14 | +on: |
| 15 | + workflow_dispatch: |
| 16 | + inputs: |
| 17 | + branch_tag: |
| 18 | + description: 'Branch version number' |
| 19 | + required: true |
| 20 | + release_tag: |
| 21 | + description: 'Release version number' |
| 22 | + required: true |
| 23 | + |
| 24 | +jobs: |
| 25 | + docker-promote: |
| 26 | + runs-on: ubuntu-latest |
| 27 | + env: |
| 28 | + BRANCH_TAG: ${{ inputs.branch_tag }} |
| 29 | + RELEASE_TAG: ${{ inputs.release_tag }} |
| 30 | + MAGMA_ARTIFACTORY: artifactory.magmacore.org |
| 31 | + steps: |
| 32 | + - uses: tspascoal/get-user-teams-membership@533553aa88900a17c59177d65bcf8c5c97ff1a90 # [email protected] |
| 33 | + name: Check if user has rights to promote |
| 34 | + id: checkUserMember |
| 35 | + with: |
| 36 | + username: ${{ github.actor }} |
| 37 | + team: 'approvers-ci' |
| 38 | + GITHUB_TOKEN: ${{ secrets.github_token }} |
| 39 | + - if: ${{ steps.checkUserMember.outputs.isTeamMember == 'false' }} |
| 40 | + run: | |
| 41 | + echo "User is not a member of the team" |
| 42 | + exit 1 |
| 43 | + - uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b # Pin v2.0.0 |
| 44 | + name: Login to Artifactory |
| 45 | + with: |
| 46 | + registry: docker.${{ env.MAGMA_ARTIFACTORY }} |
| 47 | + username: ${{ secrets.ARTIFACTORY_USERNAME }} |
| 48 | + password: ${{ secrets.ARTIFACTORY_PASSWORD }} |
| 49 | + - run: | |
| 50 | + wget https://github.com/magma/magma/raw/master/orc8r/tools/docker/promote.sh |
| 51 | + chmod 755 promote.sh |
| 52 | + # Promote Docker images |
| 53 | + ./promote.sh |
0 commit comments