diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml new file mode 100644 index 00000000..044150b8 --- /dev/null +++ b/.github/workflows/build-docker.yml @@ -0,0 +1,33 @@ +name: Docker Compose Build and Push + +on: + push: + branches: + - main + +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/package.json b/package.json index 7ec0af00..5e4dbdc5 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,9 @@ "start.pubdev": "ng serve --configuration pubdev", "start.proxy": "ng serve --configuration proxy", "start": "ng serve", - "start.docker": "npm run build.docker && docker-compose up", + "start.docker": "npm run build.docker && docker compose up", "build": "npm run gen.changelog && ng build", - "build.docker": "npm run build && docker-compose build", + "build.docker": "npm run build && docker compose build", "build.pubdev": "npm run gen.changelog && ng build --configuration pubdev", "build.kyzikos": "npm run gen.changelog && ng build --configuration kyzikos && cp -r src/cgi-bin/ dist/web-frontend-angular/cgi-bin/", "build.kleobis": "npm run gen.changelog && ng build --configuration kleobis && cp src/matomo/kleobis.js dist/web-frontend-angular/*/assets/scripts/matomo.js && cp -r src/cgi-bin/ dist/web-frontend-angular/cgi-bin/",