post: init #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 워크플로우의 이름 | |
| name: Deploy to GitHub Pages | |
| # 언제 이 워크플로우를 실행할 것인가: 태그(tag)가 push되었을 때 | |
| on: | |
| push: | |
| tags: | |
| - 'post/*' # git tag post/yyyy-mm-dd-xx.. 같은 형태의 태그에만 반응합니다. | |
| # 실행될 작업들 | |
| jobs: | |
| build-and-deploy: | |
| # 실행 환경: 최신 우분투 | |
| runs-on: ubuntu-latest | |
| # 작업 단계들 | |
| steps: | |
| # 1. 소스 코드 체크아웃 (내 저장소의 코드를 가져옴) | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| # 2. Go 언어 환경 설정 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.25' # 사용하는 Go 버전에 맞게 수정 | |
| # 3. 정적 사이트 빌드 (사용자님이 만드신 main.go 실행) | |
| - name: Build | |
| run: go run . | |
| # 4. 빌드 결과물(public 디렉터리)을 gh-pages 브랜치에 배포 | |
| - name: Deploy | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| # GitHub Actions가 커밋/푸시를 할 수 있도록 토큰을 제공합니다. | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| # 배포할 디렉터리를 지정합니다. (빌드 결과물이 담긴 곳) | |
| publish_dir: ./public | |
| # 커밋 메시지를 태그 이름으로 사용합니다. | |
| commit_message: Deploy ${{ github.ref_name }} |