Create main.yml

This commit is contained in:
Donavon McDowell 2024-08-30 08:32:07 -06:00 committed by GitHub
parent d892b38317
commit c84106d511
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

39
.github/workflows/main.yml vendored Normal file
View File

@ -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