From 38205841bcc2915745a49f99401a753ec1aa9c08 Mon Sep 17 00:00:00 2001 From: Tom Naessens Date: Sun, 9 Jun 2024 16:18:48 +0200 Subject: [PATCH] Add build github action --- .github/workflows/build.yml | 26 ++++++++++++++++++++++++++ Dockerfile | 3 +++ 2 files changed, 29 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..5ed4b802 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,26 @@ +name: Build + +on: + push: + branches: + - 'main' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - + name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v5 + with: + push: true diff --git a/Dockerfile b/Dockerfile index 8aece358..7019839c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,9 @@ RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list RUN apt update && apt install -y yarn +COPY ./package.json ./yarn.lock /app/ +RUN yarn install + COPY . /app RUN bundle exec rails assets:precompile