diff --git a/.github/workflows/docker-compose.yml b/.github/workflows/docker-compose.yml new file mode 100644 index 0000000..0a25417 --- /dev/null +++ b/.github/workflows/docker-compose.yml @@ -0,0 +1,19 @@ +name: Docker Compose CI + +on: + pull_request: + branches: [ "main" ] + +jobs: + test: + runs-on: ubuntu-latest + services: + docker: + image: docker:latest + options: --privileged + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Build Docker Prod Images + run: | + docker compose -f ci-compose.yaml build diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..75f2cef --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,26 @@ +name: Go + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.24.5' + + - name: Build + run: go build -v ./... + + - name: Test + run: go test -v ./... + diff --git a/.gitignore b/.gitignore index 9334e43..7f015a2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ /build /od-ash-tray -/ash.yaml +/ash-tray diff --git a/ci-Dockerfile b/ci-Dockerfile new file mode 100644 index 0000000..22d9b62 --- /dev/null +++ b/ci-Dockerfile @@ -0,0 +1,11 @@ +FROM golang AS build +WORKDIR /app +COPY . . +RUN CGO_ENABLED=0 GOOS=linux go build -o /od-ash-tray . + +FROM scratch +COPY --from=build /od-ash-tray /od-ash-tray + +# bandaid fix +# we'll have to fix this later... +CMD ["/od-ash-tray"] diff --git a/ci-compose.yaml b/ci-compose.yaml new file mode 100644 index 0000000..6b9e70b --- /dev/null +++ b/ci-compose.yaml @@ -0,0 +1,15 @@ +services: + od-ash_tray: + build: + dockerfile: ci-Dockerfile + ports: + - "0.0.0.0:7377:7377" + environment: + - ASH_TRAY_ID + - ASH_TRAY_DIRECTORY=/cdn + - ASH_TRAY_KEY + - ASH_TRAY_PORT=7377 + volumes: + - /cdn:/cdn:rw + - /etc/letsencrypt/live/onlinedi.vision:/certs:r +