bug: fixed the bug where the DOCKER_REGISTRY constant is stored on th… #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |