Skip to content

Commit 082736a

Browse files
committed
github workflow for building/pushing docker image
1 parent 9421619 commit 082736a

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

.github/workflows/ghcr-push.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Log in to GitHub Container Registry
17+
uses: docker/login-action@v3
18+
with:
19+
username: ${{ github.actor }}
20+
password: ${{ secrets.GITHUB_TOKEN }}
21+
22+
- name: Set up Docker Buildx
23+
uses: docker/[email protected]
24+
25+
- name: Build Docker image
26+
run: |
27+
docker build -t ghcr.io/vectordotdev/log-generator:v1.0 .
28+
29+
- name: Push Docker image
30+
run: |
31+
docker push ghcr.io/vectordotdev/log-generator:v1.0

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ COPY src ./src
1111
RUN cargo build --release
1212

1313
# Set the default command to run the log generator with the desired arguments
14-
CMD ["cargo", "run", "--release", "--", "-n", "1000", "-o", "/var/log/a_custom.log"]
14+
CMD ["./target/release/log-generator"]

0 commit comments

Comments
 (0)