Skip to content

Commit a701a97

Browse files
committed
cd: add cd.yaml
1 parent c8a8ecf commit a701a97

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

.github/workflows/cd.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
packages: write
11+
12+
jobs:
13+
build-and-push:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Log in to GitHub Container Registry
20+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
21+
22+
- name: Build Docker image
23+
run: |
24+
IMAGE_NAME=ghcr.io/${{ github.repository }}:latest
25+
docker build -t $IMAGE_NAME .
26+
27+
- name: Push Docker image to GitHub Container Registry
28+
run: |
29+
IMAGE_NAME=ghcr.io/${{ github.repository }}:latest
30+
docker push $IMAGE_NAME

0 commit comments

Comments
 (0)