@@ -106,6 +106,15 @@ jobs:
106
106
platforms : linux/amd64,linux/arm64
107
107
tags : ${{ secrets.DOCKER_USER }}/html-tutorial:latest
108
108
109
+ - name : Build and push image:tags
110
+ uses : docker/build-push-action@v3
111
+ if : steps.create_tag.outputs.successful
112
+ with :
113
+ push : true
114
+ context : .
115
+ platforms : linux/amd64,linux/arm64
116
+ tags : ${{ secrets.DOCKER_USER }}/html-tutorial:${{steps.changelog.outputs.version}}
117
+
109
118
# - name: Build docs image
110
119
# if: steps.create_tag.outputs.successful
111
120
# run: docker image build -t html-tutorial .
@@ -120,18 +129,43 @@ jobs:
120
129
# docker push ${{ secrets.DOCKER_USER }}/html-tutorial:latest
121
130
122
131
# Create Docker Image in Github
123
- - name : Login to GitHub registry
124
- run : echo ${{ github.token }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
125
132
126
- - name : Build docker image
127
- run : docker build -t ghcr.io/jaywcjlove/html-tutorial:latest .
133
+ - name : Login to the GitHub Container Registry
134
+ uses : docker/login-action@v2
135
+ with :
136
+ registry : ghcr.io
137
+ username : ${{ github.actor }}
138
+ password : ${{ secrets.GITHUB_TOKEN }}
128
139
129
- - name : Publish to GitHub registry
130
- run : docker push ghcr.io/jaywcjlove/html-tutorial:latest
140
+ - name : Build and push image:latest
141
+ uses : docker/build-push-action@v3
142
+ with :
143
+ push : true
144
+ context : .
145
+ platforms : linux/amd64,linux/arm64
146
+ tags : ghcr.io/jaywcjlove/html-tutorial:latest
131
147
132
- - name : Tag docker image (beta) and publish to GitHub registry
148
+ - name : Build and push image:tags
149
+ uses : docker/build-push-action@v3
133
150
if : steps.create_tag.outputs.successful
134
- run : |
135
- echo "version: v${{ steps.changelog.outputs.version }}"
136
- docker tag ghcr.io/jaywcjlove/html-tutorial:latest ghcr.io/jaywcjlove/html-tutorial:${{steps.changelog.outputs.version}}
137
- docker push ghcr.io/jaywcjlove/html-tutorial:${{steps.changelog.outputs.version}}
151
+ with :
152
+ push : true
153
+ context : .
154
+ platforms : linux/amd64,linux/arm64
155
+ tags : ghcr.io/jaywcjlove/html-tutorial:${{steps.changelog.outputs.version}}
156
+
157
+ # - name: Login to GitHub registry
158
+ # run: echo ${{ github.token }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
159
+
160
+ # - name: Build docker image
161
+ # run: docker build -t ghcr.io/jaywcjlove/html-tutorial:latest .
162
+
163
+ # - name: Publish to GitHub registry
164
+ # run: docker push ghcr.io/jaywcjlove/html-tutorial:latest
165
+
166
+ # - name: Tag docker image (beta) and publish to GitHub registry
167
+ # if: steps.create_tag.outputs.successful
168
+ # run: |
169
+ # echo "version: v${{ steps.changelog.outputs.version }}"
170
+ # docker tag ghcr.io/jaywcjlove/html-tutorial:latest ghcr.io/jaywcjlove/html-tutorial:${{steps.changelog.outputs.version}}
171
+ # docker push ghcr.io/jaywcjlove/html-tutorial:${{steps.changelog.outputs.version}}
0 commit comments