Skip to content

Commit 376b300

Browse files
authored
actions: Added dockerimage workflow
to push image to ghcr.io and DockerHub.
1 parent 17793dc commit 376b300

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/dockerimage.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Build Docker Image
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
jobs:
9+
# Push image to Package Registries (ghcr.io and DockerHub).
10+
build-and-push:
11+
runs-on: ubuntu-latest
12+
if: github.event_name == 'push'
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- name: Log into registry (DockerHub)
18+
uses: docker/login-action@v1
19+
with:
20+
username: ${{ secrets.DOCKERHUB_USERNAME }}
21+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
22+
23+
- name: Log into registry (ghcr.io)
24+
uses: docker/login-action@v1
25+
with:
26+
registry: ghcr.io
27+
username: ${{ github.actor }}
28+
password: ${{ secrets.GHCR_PASSWORD }}
29+
30+
- name: Extract metadata
31+
id: metadata
32+
uses: docker/metadata-action@v3
33+
with:
34+
images: |
35+
vasilev/clojurescript
36+
ghcr.io/vasilev/clojurescript
37+
38+
- name: Debug Print metadata
39+
run: echo "${{ steps.metadata.outputs }}"
40+
41+
- name: Build and push the image
42+
uses: docker/build-push-action@v2
43+
with:
44+
context: .
45+
push: true
46+
tags: ${{ steps.metadata.outputs.tags }}

0 commit comments

Comments
 (0)