Skip to content

bug: fixed the bug where the DOCKER_REGISTRY constant is stored on th… #1

bug: fixed the bug where the DOCKER_REGISTRY constant is stored on th…

bug: fixed the bug where the DOCKER_REGISTRY constant is stored on th… #1

name: Lint, Format, Build, and Push Docker Image
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install dependencies
run: npm install
- name: Format the codebase
run: npm run format
- name: Run ESLint
run: npm run lint
env:
CI: true
- name: Build the Next.js app
run: npm run build
- name: Log in to Docker
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login ${{ secrets.DOCKER_REGISTRY }} -u ${{ vars.DOCKER_USERNAME }} --password-stdin
- name: Build Docker image
run: docker build -t ${{ vars.DOCKER_REGISTRY }}/snappy-notes:latest .
- name: Push Docker image
run: docker push ${{ vars.DOCKER_REGISTRY }}/snappy-notes:latest