Skip to content

Commit d019de4

Browse files
committed
github action
1 parent 9dc3883 commit d019de4

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/docker-build.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- '**' # Trigger on pushes to any branch
7+
8+
jobs:
9+
build:
10+
if: contains(github.event.head_commit.message, '#build')
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout Code
15+
uses: actions/checkout@v3
16+
17+
- name: Set up Docker Buildx
18+
uses: docker/setup-buildx-action@v2
19+
20+
- name: Log in to GitHub Container Registry
21+
uses: docker/login-action@v2
22+
with:
23+
username: ${{ github.actor }}
24+
password: ${{ secrets.GHCR_PAT }}
25+
26+
- name: Build and Push Docker Image
27+
uses: docker/build-push-action@v4
28+
with:
29+
context: .
30+
push: true
31+
tags: |
32+
ghcr.io/${{ github.repository_owner }}/gomarks:${{ github.ref_name }}
33+
ghcr.io/${{ github.repository_owner }}/gomarks:latest
34+

0 commit comments

Comments
 (0)