Skip to content

Commit 346c536

Browse files
committed
Build and push docker image when merged
1 parent 29910c1 commit 346c536

File tree

2 files changed

+43
-9
lines changed

2 files changed

+43
-9
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Create and publish a package
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
jobs:
7+
build-and-pPush-image:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v2
12+
13+
- name: Set up Docker Buildx
14+
uses: docker/setup-buildx-action@v1
15+
16+
- name: Login to DockerHub
17+
uses: docker/login-action@v1
18+
with:
19+
username: ${{ secrets.DOCKERHUB_USERNAME }}
20+
password: ${{ secrets.DOCKERHUB_TOKEN }}
21+
22+
- name: Build and push
23+
id: docker_build
24+
uses: docker/build-push-action@v2
25+
with:
26+
push: true
27+
tags: seungkyua/tks-info:${{ github.head_ref }}

.github/workflows/deploy-image.yml

+16-9
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,26 @@ on:
33
push:
44
branches:
55
- main
6-
release:
7-
types: [published]
6+
87
jobs:
98
build-and-push-image:
109
runs-on: ubuntu-latest
1110
steps:
1211
- name: Checkout
1312
uses: actions/checkout@v2
14-
- name: Build container image
15-
uses: docker/build-push-action@v1
13+
14+
- name: Set up Docker Buildx
15+
uses: docker/setup-buildx-action@v1
16+
17+
- name: Login to DockerHub
18+
uses: docker/login-action@v1
1619
with:
17-
username: ${{ github.actor }}
18-
password: ${{ secrets.GITHUB_TOKEN }}
19-
registry: docker.pkg.github.com
20-
repository: ${{ github.repository }}/tks-info
21-
tag_with_ref: true
20+
username: ${{ secrets.DOCKERHUB_USERNAME }}
21+
password: ${{ secrets.DOCKERHUB_TOKEN }}
22+
23+
- name: Build and push
24+
id: docker_build
25+
uses: docker/build-push-action@v2
26+
with:
27+
push: true
28+
tags: seungkyua/tks-info:latest

0 commit comments

Comments
 (0)