Skip to content

Commit

Permalink
Added GitHub Actions workflow (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaronontheweb authored Dec 23, 2024
1 parent 5d633c9 commit 66535c2
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/pr_validation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: PR Validation

on:
pull_request:
branches:
- dev
push:
branches:
- dev

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build Docker image
run: |
docker build -t petabridge/pbm-sidecar:pr-validation .
- name: Run Docker container and test
run: |
docker run --rm petabridge/pbm-sidecar:pr-validation pbm help
- name: Cleanup Docker images
run: |
docker rmi petabridge/pbm-sidecar:pr-validation || true
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS base
WORKDIR /app

# Install Petabridge.Cmd client so it can be invoked remotely via
# Docker or K8s 'exec` commands
RUN dotnet tool install --global pbm

FROM mcr.microsoft.com/dotnet/runtime:8.0 AS app
WORKDIR /app

# copy .NET Core global tool
COPY --from=base /root/.dotnet /root/.dotnet/

# Needed because https://stackoverflow.com/questions/51977474/install-dotnet-core-tool-dockerfile
ENV PATH="${PATH}:/root/.dotnet/tools"

# Set the entrypoint to keep the container running
ENTRYPOINT ["tail", "-f", "/dev/null"]

0 comments on commit 66535c2

Please sign in to comment.