Skip to content

Commit bb66a0f

Browse files
committed
build: add image publishing
1 parent e9648cb commit bb66a0f

File tree

1 file changed

+35
-2
lines changed

1 file changed

+35
-2
lines changed

.github/workflows/pull_request.yaml renamed to .github/workflows/cicd.yaml

+35-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
name: PR Checks
2-
on: [pull_request]
1+
name: CI/CD Workflow
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
38
jobs:
49
install_modules:
510
runs-on: ubuntu-latest
@@ -77,3 +82,31 @@ jobs:
7782
name: Base Setup
7883
- name: Building app
7984
run: pnpm run build
85+
86+
docker-publish:
87+
if: github.ref == 'refs/heads/main'
88+
runs-on: ubuntu-latest
89+
needs: build
90+
steps:
91+
- name: Checkout code
92+
uses: actions/checkout@v4
93+
94+
- name: Set up Docker Buildx
95+
uses: docker/setup-buildx-action@v2
96+
97+
- name: Log in to GitHub Container Registry
98+
uses: docker/login-action@v2
99+
with:
100+
registry: ghcr.io
101+
username: ${{ github.actor }}
102+
password: ${{ secrets.GITHUB_TOKEN }}
103+
104+
- name: Build and push Docker image
105+
uses: docker/build-push-action@v5
106+
with:
107+
context: .
108+
push: true
109+
tags: ghcr.io/inkonchain/docs:latest
110+
111+
- name: Log out from GitHub Container Registry
112+
run: docker logout ghcr.io

0 commit comments

Comments
 (0)