-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (35 loc) · 1.08 KB
/
docker-cd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Docker CD
on:
push:
tags:
- '**'
# branches:
# - 'main'
jobs:
Build-Upload-Image:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Generate Docker metadata
id: docker_meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/inu-appcenter/NoticeAlarm-server
# type=ref는 메인 브랜치 푸시용, type=semver는 태그 푸시용. 전자는 안 쓸 것이지만 써놓긴 함.
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ steps.docker_meta.outputs.tags }}