-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (40 loc) · 1.33 KB
/
deploy.yml
File metadata and controls
47 lines (40 loc) · 1.33 KB
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
42
43
44
45
46
47
name: Build and Publish Blog Image
on:
push:
branches: [ "main" ] # main 브랜치에 코드가 들어올 때만 트리거
env:
REGISTRY: ghcr.io
IMAGE_NAME: lim-han/blog
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write # GHCR에 이미지를 Push하기 위한 권한 (IAM)
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive # 핵심 에러 핸들링: PaperMod 테마를 온전히 가져오기 위함
fetch-depth: 0
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} # GitHub이 임시 발급하는 안전한 토큰 사용
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}