From c84106d511617a080d568326c9c0cb1c663095dd Mon Sep 17 00:00:00 2001 From: donavon04 Date: Fri, 30 Aug 2024 08:32:07 -0600 Subject: [PATCH] Create main.yml --- .github/workflows/main.yml | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..5ad7d5c --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,39 @@ +name: Build and push Docker image to DockerHub + +on: + push: + branches: [ "main" ] + +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