Skip to content

Commit

Permalink
Automate builds (#16)
Browse files Browse the repository at this point in the history
Add GH action to automate builds on DH
  • Loading branch information
nag763 authored Aug 31, 2024
1 parent 5a14e18 commit 625206d
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 5 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@

name: Rust

on: [push, pull_request]
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]


env:
CARGO_TERM_COLOR: always
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/docker_refresh.yml
Original file line number Diff line number Diff line change
@@ -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: ./
2 changes: 0 additions & 2 deletions Dockerfile_front
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 625206d

Please sign in to comment.