|
86 | 86 | env: |
87 | 87 | IMAGE: ${{ steps.get_repo.outputs.IMAGE }} |
88 | 88 | BRANCH: ${{ steps.get_branch.outputs.BRANCH }} |
89 | | - debug: |
90 | | - timeout-minutes: 30 |
91 | | - runs-on: ubuntu-latest |
92 | | - steps: |
93 | | - - |
94 | | - name: Checkout Repo |
95 | | - uses: actions/checkout@v2 |
96 | | - - |
97 | | - name: Build registry path |
98 | | - id: get_repo |
99 | | - run: echo ::set-output name=IMAGE::"$REGISTRY/$OWNER/ids-appstore" |
100 | | - - |
101 | | - name: Find tag |
102 | | - id: get_tag |
103 | | - run: | |
104 | | - echo ${GITHUB_REF#refs/tags/} |
105 | | - echo ::set-output name=TAG::${GITHUB_REF#refs/tags/} |
106 | | - if: startsWith(github.ref, 'refs/tags') |
107 | | - - |
108 | | - name: Find branch name |
109 | | - id: get_branch |
110 | | - run: | |
111 | | - # to lowercase |
112 | | - TMP=$(git rev-parse --abbrev-ref HEAD) |
113 | | - TMP=$(echo "$TMP" | tr '[:upper:]' '[:lower:]') |
114 | | - echo $TMP |
115 | | - echo ::set-output name=BRANCH::$TMP |
116 | | - - |
117 | | - name: Login to registry |
118 | | - uses: docker/login-action@v1 |
119 | | - with: |
120 | | - # This should use REGISTRY instead of the secret directly |
121 | | - registry: ${{ secrets.IMAGE_REGISTRY }} |
122 | | - username: ${{ secrets.REPO_USER }} |
123 | | - password: ${{ secrets.DOCKHUB_TOKEN }} |
124 | | - - |
125 | | - name: Build image |
126 | | - run: | |
127 | | - docker build . -f scripts/ci/docker/Debug.dockerfile -t $IMAGE:$BRANCH |
128 | | - env: |
129 | | - IMAGE: ${{ steps.get_repo.outputs.IMAGE }} |
130 | | - BRANCH: ${{ steps.get_branch.outputs.BRANCH }} |
131 | | - DOCKER_BUILDKIT: 1 |
132 | | - - |
133 | | - name: Push tagged image |
134 | | - run: | |
135 | | - echo $IMAGE |
136 | | - echo $BRANCH |
137 | | - echo $TAG |
138 | | - TMP=$TAG |
139 | | - if [[ $TMP == v* ]] |
140 | | - then |
141 | | - # Its a version tag |
142 | | - TMP=${TAG:1:${#TAG}} |
143 | | - echo "Found a version tag" |
144 | | - fi |
145 | | - # Has tag |
146 | | - docker tag $IMAGE:$BRANCH $IMAGE:$TMP-debug |
147 | | - docker push $IMAGE:$TMP-debug |
148 | | - if: startsWith(github.ref, 'refs/tags') |
149 | | - env: |
150 | | - IMAGE: ${{ steps.get_repo.outputs.IMAGE }} |
151 | | - BRANCH: ${{ steps.get_branch.outputs.BRANCH }} |
152 | | - TAG: ${{ steps.get_tag.outputs.TAG }} |
153 | | - - |
154 | | - name: Push branch image |
155 | | - run: | |
156 | | - docker tag $IMAGE:$BRANCH $IMAGE:$BRANCH-debug |
157 | | - docker push $IMAGE:$BRANCH-debug |
158 | | - if: startsWith(github.ref, 'refs/heads') |
159 | | - env: |
160 | | - IMAGE: ${{ steps.get_repo.outputs.IMAGE }} |
161 | | - BRANCH: ${{ steps.get_branch.outputs.BRANCH }} |
0 commit comments