chore: github ci build
This commit is contained in:
parent
13bf3eb5b4
commit
20af833f1c
4 changed files with 70 additions and 0 deletions
4
.dockerignore
Normal file
4
.dockerignore
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
./node_modules
|
||||||
|
.git
|
||||||
|
.direnv
|
||||||
|
.envrc
|
||||||
19
.github/workflows/build.yml
vendored
Normal file
19
.github/workflows/build.yml
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
name: build
|
||||||
|
|
||||||
|
on: [workflow_dispatch]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
everything:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Get Repo
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Run script
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
chmod +x ./build-scripts/ci-build.sh
|
||||||
|
./build-scripts/ci-build.sh
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: lamassu-server.tar.gz
|
||||||
|
path: ./lamassu-server.tar.gz
|
||||||
39
build/Dockerfile.ci
Normal file
39
build/Dockerfile.ci
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
FROM ubuntu:20.04 as base
|
||||||
|
|
||||||
|
ARG VERSION
|
||||||
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
ENV TZ=Europe/Lisbon
|
||||||
|
|
||||||
|
RUN apt-get update
|
||||||
|
|
||||||
|
RUN apt-get install -y -q curl \
|
||||||
|
sudo \
|
||||||
|
git \
|
||||||
|
python2-minimal \
|
||||||
|
build-essential \
|
||||||
|
libpq-dev \
|
||||||
|
net-tools \
|
||||||
|
tar
|
||||||
|
|
||||||
|
RUN curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
|
||||||
|
RUN apt-get install nodejs -y -q
|
||||||
|
|
||||||
|
FROM base as l-s-build
|
||||||
|
|
||||||
|
WORKDIR lamassu-server
|
||||||
|
|
||||||
|
# # Prevent cache invalidation when we only change version numbers
|
||||||
|
COPY ["package.json", "package-lock.json", "./"]
|
||||||
|
RUN npm version --allow-same-version --git-tag-version false --commit-hooks false 1.0.0
|
||||||
|
RUN npm install --production
|
||||||
|
|
||||||
|
COPY . ./
|
||||||
|
RUN rm -rf public/*
|
||||||
|
|
||||||
|
RUN cd new-lamassu-admin && npm install && npm run build
|
||||||
|
RUN cp -r new-lamassu-admin/build/* public
|
||||||
|
RUN rm -rf new-lamassu-admin/node_modules
|
||||||
|
|
||||||
|
RUN cd .. && tar -zcvf lamassu-server.tar.gz ./lamassu-server
|
||||||
|
|
||||||
|
ENTRYPOINT [ "/bin/bash" ]
|
||||||
8
build/ci-build.sh
Normal file
8
build/ci-build.sh
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
docker build -t build:latest -f build-scripts/Dockerfile.ci build-scripts/Dockerfile.ci .
|
||||||
|
|
||||||
|
id=$(docker create build)
|
||||||
|
docker cp $id:/lamassu-server.tar.gz ./lamassu-server.tar.gz
|
||||||
|
docker rm -v $id
|
||||||
Loading…
Add table
Add a link
Reference in a new issue