diff --git a/.github/file-filters.yml b/.github/file-filters.yml index 698385209..7dc1a3cba 100644 --- a/.github/file-filters.yml +++ b/.github/file-filters.yml @@ -58,4 +58,7 @@ mariadb: &mariadb - 'mariadb/**/*' nginx: &nginx - - 'nginx/**/*' \ No newline at end of file + - 'nginx/**/*' + +deploy-bare-metal: &deploy-bare-metal + - 'deployment/bare_metal/**/*' \ No newline at end of file diff --git a/.github/workflows/test_deploy.yml b/.github/workflows/test_deploy.yml new file mode 100644 index 000000000..9570ac455 --- /dev/null +++ b/.github/workflows/test_deploy.yml @@ -0,0 +1,32 @@ +name: Gradido Deploy Test CI + +on: push + +jobs: + files-changed: + name: Detect File Changes - Deploy Bare Metal + runs-on: ubuntu-latest + outputs: + deploy-bare-metal: ${{ steps.changes.outputs.deploy-bare-metal }} + steps: + - uses: actions/checkout@v4 + + - name: Check for deploy-bare-metal file changes + uses: dorny/paths-filter@v2.11.1 + id: changes + with: + token: ${{ github.token }} + filters: .github/file-filters.yml + list-files: shell + + build_test: + if: needs.files-changed.outputs.deploy-bare-metal == 'true' + name: Docker Build Test - Deploy Bare Metal + needs: files-changed + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Deploy Bare Metal | Build image + run: docker build -f ./deployment/bare_metal/Dockerfile --build-arg BRANCH_NAME=${{ github.ref_name }} -t "gradido/deploy-bare-metal:local" . diff --git a/deployment/bare_metal/Dockerfile b/deployment/bare_metal/Dockerfile index 5ff1ab2c4..834686759 100644 --- a/deployment/bare_metal/Dockerfile +++ b/deployment/bare_metal/Dockerfile @@ -53,7 +53,6 @@ RUN ln -s /app/gradido/deployment/bare_metal/nginx/sites-enabled/default /etc/ng RUN ln -s /app/gradido/deployment/bare_metal/nginx/common /etc/nginx/ RUN rmdir /etc/nginx/conf.d RUN ln -s /app/gradido/deployment/bare_metal/nginx/conf.d /etc/nginx/ -RUN nginx -t SHELL ["/bin/bash", "--login", "-c"] RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash @@ -107,6 +106,8 @@ RUN envsubst "$(env | sed -e 's/=.*//' -e 's/^/\$/g')" < federation/.env.templat ########################################################################################### FROM install as start +RUN /etc/init.d/mariadb start + WORKDIR /app/gradido/deployment/bare_metal # mock sudo