Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @PsycleResearch/devs-back
10 changes: 0 additions & 10 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

34 changes: 34 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: 2

updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: /
schedule:
interval: weekly
day: "friday"
time: "08:00"
timezone: "Europe/Paris"
target-branch: master
assignees:
- mbaumanndev
- Mindstan
labels:
- dependencies
rebase-strategy: disabled

# Maintain dependencies for the Dockerfile
- package-ecosystem: docker
directory: /
schedule:
interval: weekly
day: "friday"
time: "08:00"
timezone: "Europe/Paris"
target-branch: master
assignees:
- mbaumanndev
- Mindstan
labels:
- dependencies
rebase-strategy: disabled
79 changes: 79 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: PR checks

on:
push:
branches: [master]
pull_request:
types: [opened, ready_for_review, synchronize, reopened]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

jobs:
queue:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false || github.ref == 'refs/heads/master'
timeout-minutes: 1

outputs:
should_skip: ${{ steps.skip.outputs.should_skip }}
paths_result: ${{ steps.skip.outputs.paths_result }}

steps:
- id: skip
uses: fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: "same_content_newer"
cancel_others: true
skip_after_successful_duplicate: true
do_not_skip: '["workflow_dispatch", "schedule"]'
paths: '["Dockerfile", ".dockerignore", "Makefile", ".github/workflows/pr-checks.yml"]'
paths_filter: |
image:
paths:
- "Dockerfile"
- ".dockerignore"
- "Makefile"
ci:
paths:
- ".github/workflows/pr-checks.yml"

build-image:
runs-on: ubuntu-latest
needs: queue
if: github.ref == 'refs/heads/master' || ( needs.queue.outputs.should_skip != 'true' && ( !fromJSON(needs.queue.outputs.paths_result).image.should_skip || !fromJSON(needs.queue.outputs.paths_result).ci.should_skip ) )
timeout-minutes: 10

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build image
run: make image

status:
runs-on: ubuntu-latest
needs: [queue, build-image]
if: ${{ always() && !cancelled() }}
timeout-minutes: 1

steps:
- name: Check status
env:
QUEUE_OK: ${{ needs.queue.result == 'success' }}
IMAGE_OK: ${{ needs.build-image.result == 'success' || needs.build-image.result == 'skipped' }}
run: |
echo "Queue: $QUEUE_OK"
echo "Frontend: $IMAGE_OK"
if [[ $QUEUE_OK == "true" && $IMAGE_OK == "true" ]]; then
echo "All good"
exit 0
else
echo "Something went wrong"
exit 1
fi
26 changes: 14 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,6 @@ RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2
./aws/install && \
rm -rf aws awscliv2.zip

# Install NodeJS
ARG NODE_MAJOR=24

RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
apt-get update && apt-get install nodejs -y && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean &&\
npm install --global corepack &&\
corepack enable

# Install Golang
ARG GOLANG_VER=1.23.2
RUN curl -fsSL https://go.dev/dl/go${GOLANG_VER}.linux-amd64.tar.gz | tar -C /usr/local -xz
Expand All @@ -52,9 +41,19 @@ WORKDIR ${HOME}
RUN mkdir -p ${HOME}/go
ENV PATH=${HOME}/go/bin:${PATH}

ENV PYENV_ROOT=${HOME}/.pyenv
# Install NVM & Node
ARG NODE_MAJOR=24
ENV NVM_VERSION=v0.40.3
ENV NVM_DIR="${HOME}/.nvm"
ENV BASH_ENV="${HOME}/.bash_env"
RUN touch "${BASH_ENV}" && \
echo '. "${BASH_ENV}"' >> ~/.bashrc && \
mkdir -p ${NVM_DIR} && \
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/${NVM_VERSION}/install.sh | PROFILE="${BASH_ENV}" bash && \
/bin/bash -c "source ${NVM_DIR}/nvm.sh && nvm install ${NODE_MAJOR}"

# Install Pyenv
ENV PYENV_ROOT=${HOME}/.pyenv
RUN git clone https://github.com/pyenv/pyenv.git ${PYENV_ROOT} && \
cd ${PYENV_ROOT} && src/configure && make -C src

Expand All @@ -79,4 +78,7 @@ RUN PYTHON_CONFIGURE_OPTS=--enable-shared pyenv install 3.9 && \
ARG POETRY_VERSION=2.1.3
RUN curl -sSL https://install.python-poetry.org | python3 - --version ${POETRY_VERSION}

# set ENTRYPOINT for reloading nvm-environment
ENTRYPOINT ["bash", "-c", "source $NVM_DIR/nvm.sh && exec \"$@\"", "--"]

CMD ["/bin/bash"]