From 896e8879c2210851f03b43d1df2d5381dfb71715 Mon Sep 17 00:00:00 2001 From: Adam Hlavacek Date: Tue, 12 Nov 2024 18:34:11 +0100 Subject: [PATCH] feat(docker): autobuild --- .github/workflows/build-docker.yml | 34 ++++++++++++++++++++++++++++++ docker-compose.yaml | 6 +++--- 2 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/build-docker.yml diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml new file mode 100644 index 0000000..1b09ad5 --- /dev/null +++ b/.github/workflows/build-docker.yml @@ -0,0 +1,34 @@ +name: Docker Compose Build and Push + +on: + push: + branches: + - main + - master + +jobs: + build_and_push: + runs-on: ubuntu-latest + + steps: + - name: Check out the repository, including submodules + uses: actions/checkout@v3 + with: + submodules: recursive + path: web + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push Docker images + working-directory: ./web + run: | + npm install + npm run build.docker + docker compose push diff --git a/docker-compose.yaml b/docker-compose.yaml index b85eaca..e511576 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -5,7 +5,7 @@ services: build: context: . dockerfile: .docker/Dockerfile - image: esoadamo/ksi-be + image: fi0ksi/ksi-be ports: - "3030:3030" volumes: @@ -25,11 +25,11 @@ services: entrypoint: ["/bin/bash", "./.docker/entrypoint.sh"] ksi-fe-dev: container_name: ksi-fe-local - image: esoadamo/ksi-fe-local + image: fi0ksi/ksi-fe-local ports: - "4201:80" ksi-fe-old-dev: container_name: ksi-fe-old-dev - image: esoadamo/ksi-fe-old-local + image: fi0ksi/ksi-fe-old-local ports: - "8080:80"