diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7515c93..33ad1d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,12 @@ name: Rust -on: [push, pull_request] +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + env: CARGO_TERM_COLOR: always diff --git a/.github/workflows/docker_refresh.yml b/.github/workflows/docker_refresh.yml new file mode 100644 index 0000000..cf6e6ba --- /dev/null +++ b/.github/workflows/docker_refresh.yml @@ -0,0 +1,24 @@ +name: Docker images build + +on: + push: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: DockerHub login + env: + LOGIN: ${{ secrets.DOCKERHUB_USERNAME }} + PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} + run: echo $PASSWORD | docker login -u $LOGIN --password-stdin + - name: Install docker compose + run: sudo apt-get update; sudo apt-get install docker-compose -y + - name: Build project + run: docker-compose build --parallel + working-directory: ./ + - name: Push image + run: docker-compose push + working-directory: ./ \ No newline at end of file diff --git a/Dockerfile_front b/Dockerfile_front index 1b559ec..6702c60 100644 --- a/Dockerfile_front +++ b/Dockerfile_front @@ -58,6 +58,4 @@ WORKDIR /usr/share/nginx/html COPY --from=compressor /usr/tchatchers/dist /usr/share/nginx/html -COPY .git/refs/heads/main /usr/share/nginx/html/.rev - EXPOSE 80 diff --git a/docker-compose.yml b/docker-compose.yml index 015ac39..aa80982 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -88,10 +88,9 @@ services: cli : image: nag763/tchatchers_tct:latest command: ["--docker-service"] - env_file: - - .env volumes: - static:/home/usr/tct/static + - .env:/home/usr/tct/.env links: - postgres:${POSTGRES_HOST:-pg.tchatche.rs} - redis:${REDIS_HOST:-redis.tchatche.rs}