Update nextjs.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: WordPress CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
paths-ignore: | |
- '**/*.md' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '7.4' | |
- name: Cache Composer dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ~/.composer/cache | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: Install dependencies | |
run: cd wordpress-app && composer install | |
- name: Install PHPUnit | |
run: composer require --dev phpunit/phpunit | |
- name: Test | |
run: vendor/bin/phpunit | |
- name: Dockerhub Login | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ vars.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Build Docker image | |
run: docker build -t ${{ vars.DOCKERHUB_USERNAME }}/wordpress-app ./wordpress-app | |
- name: Push Docker image | |
run: docker push ${{ vars.DOCKERHUB_USERNAME }}/wordpress-app |