Merge branch 'main' of github.com:umituz/laravel-testcase #3
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: TheFrontendProject | |
on: | |
push: | |
branches: ["master", "main"] | |
pull_request: | |
branches: ["master", "main"] | |
jobs: | |
eslint: | |
name: ESLint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 2 | |
- name: Install Node.js | |
run: | | |
curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash - | |
sudo apt-get install -y nodejs | |
working-directory: ./frontend | |
- name: Install ESLint | |
run: npm install eslint --save-dev | |
working-directory: ./frontend | |
- name: Run ESLint | |
run: npx eslint . | |
working-directory: ./frontend | |
frontend: | |
name: NextSetup | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Update apt packages | |
run: | | |
sudo apt-get update | |
sudo apt-get upgrade -y | |
working-directory: ./frontend | |
- name: Clean apt cache | |
run: sudo apt-get clean | |
working-directory: ./frontend | |
- name: Remove containerd.io | |
run: sudo apt-get remove containerd.io | |
working-directory: ./frontend | |
- name: Reinstall Docker | |
run: | | |
sudo apt-get install -y docker.io | |
sudo systemctl start docker | |
working-directory: ./frontend | |
- name: Set Docker Build Context | |
run: echo "DOCKER_BUILDKIT=1" | sudo tee -a /etc/environment | |
working-directory: ./frontend | |
- name: Build and deploy Docker container | |
run: | | |
docker build -t frontend-app . | |
docker run -d -p 3000:3000 frontend-app | |
working-directory: ./frontend |