41 lines
1015 B
YAML
41 lines
1015 B
YAML
on:
|
|
push:
|
|
branches:
|
|
- main # Change this to your default branch if it's differ ent
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: 18 # Use Node.js 18 here
|
|
|
|
- name: Install dependencies
|
|
run: npm install
|
|
|
|
- name: Build site
|
|
run: npm run build
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Log in to Docker Hub - Main web app container registry
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.USERNAME }}
|
|
password: ${{ secrets.PASSWORD }}
|
|
|
|
- name: Build and push Main web app container image to registry
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
push: true
|
|
tags: ${{ secrets.USERNAME }}/project:latest
|
|
file: ./Dockerfile.prod |