diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml new file mode 100644 index 0000000..4c5e816 --- /dev/null +++ b/.github/workflows/build-docker-image.yml @@ -0,0 +1,49 @@ +name: Docker Image CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + # setup node + - uses: actions/setup-node@v3 + with: + node-version: '20.8.1' + # install dependencies + - name: Install dependencies + run: | + yarn install --frozen-lockfile + # build application + - uses: mansagroup/nrwl-nx-action@v3 + with: + targets: build-with-frontend + projects: hotel-management-system-backend + affected: false + # build and push to dockerhub + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Setup docker buildx + uses: docker/setup-buildx-action@v2 + - name: Build and push + uses: docker/build-push-action@v4 + with: + platforms: linux/amd64, linux/arm64/v8 + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/hotel-management-system:latest + file: ./dockerfile + context: . \ No newline at end of file diff --git a/Dockerfile b/dockerfile similarity index 100% rename from Dockerfile rename to dockerfile