From 5bf8fb0c9923117b09cf64f7adf81d05e1344d0f Mon Sep 17 00:00:00 2001 From: Santi Lertsumran Date: Thu, 29 Aug 2024 15:16:36 +0700 Subject: [PATCH] ci: update gleam version and fix workflow --- .github/workflows/build.yml | 11 ++++++++++- .github/workflows/dast.yml | 2 +- .github/workflows/playwright.yml | 2 +- .github/workflows/test.yml | 2 +- Dockerfile | 18 ++++++++---------- 5 files changed, 21 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 931f1bd..4bb6397 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,16 @@ jobs: runs-on: ubuntu-latest steps: - name: 'Checkout GitHub Action' - uses: actions/checkout@main + uses: actions/checkout@v4 + + - name: Set up Gleam, Beam + uses: erlef/setup-beam@v1 + with: + otp-version: "26.0.2" + gleam-version: "1.4.1" + rebar3-version: "3" + - run: gleam deps download + - run: gleam build - name: 'Login to GitHub Container Registry' uses: docker/login-action@v1 diff --git a/.github/workflows/dast.yml b/.github/workflows/dast.yml index 223dae1..010ace5 100644 --- a/.github/workflows/dast.yml +++ b/.github/workflows/dast.yml @@ -38,7 +38,7 @@ jobs: uses: erlef/setup-beam@v1 with: otp-version: "26.0.2" - gleam-version: "1.2.0" + gleam-version: "1.4.1" rebar3-version: "3" - name: "Start Backend" env: diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index ca63dd2..860028c 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -38,7 +38,7 @@ jobs: uses: erlef/setup-beam@v1 with: otp-version: "26.0.2" - gleam-version: "1.2.0" + gleam-version: "1.4.1" rebar3-version: "3" - name: "Start Backend" env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8df57c2..69e49ce 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: - uses: erlef/setup-beam@v1 with: otp-version: "26.0.2" - gleam-version: "1.2.0" + gleam-version: "1.4.1" rebar3-version: "3" # elixir-version: "1.15.4" - run: gleam deps download diff --git a/Dockerfile b/Dockerfile index a62dc92..c0681da 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,16 +3,14 @@ FROM ghcr.io/gleam-lang/gleam:v1.4.1-erlang-alpine # Add project code COPY . /build/ -# Compile the Gleam application -RUN apk add gcc build-base \ - && cd /build \ - && gleam export erlang-shipment \ - && mv build/erlang-shipment /app \ - && rm -r /build \ - && apk del gcc build-base \ - && addgroup -S crappy \ - && adduser -S crappy -G crappy \ - && chown -R crappy /app +# Compile the project +RUN cd /build \ +&& gleam export erlang-shipment \ +&& mv build/erlang-shipment /app \ +&& rm -r /build \ +&& addgroup -S crappy \ +&& adduser -S crappy -G crappy \ +&& chown -R crappy /app # Run the application USER crappy