This repository has been archived by the owner on Jun 1, 2024. It is now read-only.
avoid copying .env in the Dockerfile and leave it as volume instead #4
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: CI/CD | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- "*" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: Install Dependencies | |
run: npm install | |
- name: Run Tests | |
run: npm test | |
- name: Build and Push Docker image | |
run: | | |
docker build -t ${{ secrets.DOCKER_USERNAME }}/auth-fr-edition:latest -f docker/Dockerfile . | |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_HUB_TOKEN }} | |
docker push ${{ secrets.DOCKER_USERNAME }}/auth-fr-edition:latest | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to Production | |
run: | | |
# The delpoment script is not implemented yet |