name: Build and push Docker image to DockerHub on: push: branches: [ "master" ] jobs: build: runs-on: ubuntu-latest steps: - name: Check out the repo uses: actions/checkout@v4 - name: Set up Node.js (if you're using Node.js for building) uses: actions/setup-node@v3 with: node-version: '22' # Adjust the Node.js version as needed - name: Install dependencies run: npm install - name: Build project run: npm run build - name: Login to DockerHub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push to DockerHub uses: docker/build-push-action@v5 with: context: . push: true tags: mpeadmin/licensetrackerfrontend:latest