From 0a485436adc7de0e2ebdb7acbe91e52d7e286456 Mon Sep 17 00:00:00 2001 From: Ana Alexandru-Gabriel Date: Fri, 10 Oct 2025 19:29:32 +0300 Subject: [PATCH 1/3] devops(CI): adding CI to ash-tray I added two CI pipelines to this repo: - go test pipeline (to test that go builds properly) - docker compose pipeline (to test that docker compose builds properly) --- .github/workflows/docker-compose.yml | 22 ++++++++++++++++++++++ .github/workflows/go.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .github/workflows/docker-compose.yml create mode 100644 .github/workflows/go.yml diff --git a/.github/workflows/docker-compose.yml b/.github/workflows/docker-compose.yml new file mode 100644 index 0000000..e2a0560 --- /dev/null +++ b/.github/workflows/docker-compose.yml @@ -0,0 +1,22 @@ +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 compose.yaml build + - name: Build Docker Shadow Images + run: | + docker compose -f shadow-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 ./... + From cad80505c63255a39fb7302921b859bc03dde8d4 Mon Sep 17 00:00:00 2001 From: Ana Alexandru-Gabriel Date: Fri, 10 Oct 2025 19:38:44 +0300 Subject: [PATCH 2/3] devops: add ash.yaml test --- ash.yaml | 1 + 1 file changed, 1 insertion(+) create mode 100644 ash.yaml diff --git a/ash.yaml b/ash.yaml new file mode 100644 index 0000000..c6cac69 --- /dev/null +++ b/ash.yaml @@ -0,0 +1 @@ +empty From e71c2111068b977e56b803cc07ce36b3a9cb95e8 Mon Sep 17 00:00:00 2001 From: Ana Alexandru-Gabriel Date: Fri, 10 Oct 2025 19:52:51 +0300 Subject: [PATCH 3/3] devops(ci): added compose and Docker files for CI github actions pipeline --- .github/workflows/docker-compose.yml | 5 +---- .gitignore | 2 +- ash.yaml | 1 - ci-Dockerfile | 11 +++++++++++ ci-compose.yaml | 15 +++++++++++++++ 5 files changed, 28 insertions(+), 6 deletions(-) delete mode 100644 ash.yaml create mode 100644 ci-Dockerfile create mode 100644 ci-compose.yaml diff --git a/.github/workflows/docker-compose.yml b/.github/workflows/docker-compose.yml index e2a0560..0a25417 100644 --- a/.github/workflows/docker-compose.yml +++ b/.github/workflows/docker-compose.yml @@ -16,7 +16,4 @@ jobs: uses: actions/checkout@v4 - name: Build Docker Prod Images run: | - docker compose -f compose.yaml build - - name: Build Docker Shadow Images - run: | - docker compose -f shadow-compose.yaml build + docker compose -f ci-compose.yaml build 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/ash.yaml b/ash.yaml deleted file mode 100644 index c6cac69..0000000 --- a/ash.yaml +++ /dev/null @@ -1 +0,0 @@ -empty 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 +