Skip to content

Commit b6e64ab

Browse files
committed
doc: update workflows config.
1 parent e12a693 commit b6e64ab

File tree

1 file changed

+45
-11
lines changed

1 file changed

+45
-11
lines changed

.github/workflows/ci.yml

+45-11
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,15 @@ jobs:
106106
platforms: linux/amd64,linux/arm64
107107
tags: ${{ secrets.DOCKER_USER }}/html-tutorial:latest
108108

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+
109118
# - name: Build docs image
110119
# if: steps.create_tag.outputs.successful
111120
# run: docker image build -t html-tutorial .
@@ -120,18 +129,43 @@ jobs:
120129
# docker push ${{ secrets.DOCKER_USER }}/html-tutorial:latest
121130

122131
# 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
125132

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 }}
128139

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
131147

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
133150
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

Comments
 (0)