Skip to content

Commit 350b070

Browse files
authored
Create CI for building/pushing image on PR
1 parent 7058070 commit 350b070

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
7+
8+
jobs:
9+
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Check out
15+
uses: actions/checkout@v2
16+
17+
- name: Docker meta
18+
id: docker_meta
19+
uses: crazy-max/ghaction-docker-meta@v1
20+
with:
21+
images: docker.io/anik120/cool-catalog
22+
tag-sha: true
23+
tag-edge: false
24+
tags: ${{github.event.number}}
25+
26+
- name: Set up QEMU
27+
uses: docker/setup-qemu-action@v1
28+
29+
- name: Set up Docker Buildx
30+
uses: docker/setup-buildx-action@v1
31+
32+
- name: Login to DockerHub
33+
uses: docker/login-action@v1
34+
with:
35+
registry: docker.io
36+
username: ${{ secrets.DOCKER_USERNAME }}
37+
password: ${{ secrets.DOCKER_PASSWORD }}
38+
39+
- name: Build image
40+
uses: docker/build-push-action@v2
41+
with:
42+
tags: ${{ steps.docker_meta.outputs.tags }}
43+
file: CoolCatalog.Dockerfile
44+
context: .
45+
46+
- name: Push image
47+
uses: docker/build-push-action@v2
48+
with:
49+
push: true
50+
tags: ${{ steps.docker_meta.outputs.tags }}
51+
file: CoolCatalog.Dockerfile
52+
context: .

0 commit comments

Comments
 (0)