Skip to content

Commit 926336e

Browse files
author
Ahmad Nassri
committed
ci(docker): publish to docker hub and github registry
1 parent 5b197c7 commit 926336e

File tree

1 file changed

+32
-6
lines changed

1 file changed

+32
-6
lines changed

.github/workflows/release.yml

+32-6
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ jobs:
2222

2323
runs-on: ubuntu-latest
2424

25+
outputs:
26+
published: ${{ steps.release.outputs.published }}
27+
release-version: ${{ steps.release.outputs.release-version }}
28+
release-version-major: ${{ steps.release.outputs.release-version-major }}
29+
2530
steps:
2631
- uses: actions/checkout@v2
2732
- uses: actions/[email protected]
@@ -32,12 +37,33 @@ jobs:
3237
env:
3338
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3439

35-
- if: steps.release.outputs.published == 'true'
40+
publish:
41+
needs: release
42+
if: needs.release.outputs.published == 'true'
43+
runs-on: ubuntu-latest
44+
strategy:
45+
matrix:
46+
docker:
47+
- name: docker hub
48+
registry: registry.hub.docker.com
49+
password: DOCKER_PASSWORD
50+
repository: ${{ github.event.repository.full_name }}
51+
52+
- name: github package registry
53+
password: GITHUB_TOKEN
54+
registry: docker.pkg.github.com
55+
repository: ${{ github.event.repository.full_name }}/${{ github.event.repository.name }}
56+
57+
steps:
58+
- name: checkout
59+
uses: actions/checkout@v2
60+
61+
- name: ${{ matrix.docker.name }}
3662
uses: docker/build-push-action@v1
3763
with:
3864
add_git_labels: true
39-
username: ahmadnassri
40-
password: ${{ secrets.DOCKER_PASSWORD }}
41-
registry: registry.hub.docker.com
42-
repository: ahmadnassri/action-semantic-release
43-
tags: latest, v${{ steps.release.outputs.release-version-major }}, v${{ steps.release.outputs.release-version }}
65+
username: ${{ github.repository_owner }}
66+
password: ${{ secrets[matrix.docker.password] }}
67+
registry: ${{ matrix.docker.registry }}
68+
repository: ${{ matrix.docker.repository }}
69+
tags: latest, v${{ needs.release.outputs.release-version-major }}, ${{ needs.release.outputs.version }}

0 commit comments

Comments
 (0)