Update wordpress.yml #95
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: Next.js CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
paths-ignore: | |
- '**/*.md' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
- name: Cache node modules | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.npm | |
node_modules | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install dependencies | |
run: npm install | |
working-directory: ./nextjs-app | |
- name: Install Eslint and Prettier | |
run: npm install eslint prettier eslint-config-prettier eslint-plugin-prettier --save-dev | |
working-directory: ./nextjs-app | |
- name: Run linter | |
run: npm run lint | |
working-directory: ./nextjs-app | |
- name: Run tests | |
run: npm run test | |
working-directory: ./nextjs-app | |
- name: Dockerhub Login | |
uses: docker/[email protected] | |
with: | |
username: ${{ vars.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Build Docker image | |
run: docker build -t ${{ vars.DOCKERHUB_USERNAME }}/nextjs-app ./nextjs-app | |
- name: Push Docker image | |
run: docker push ${{ vars.DOCKERHUB_USERNAME }}/nextjs-app |