Skip to content

Commit

Permalink
AddGitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano committed Oct 14, 2023
1 parent b65d04a commit ea147c8
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 1 deletion.
83 changes: 83 additions & 0 deletions .github/workflows/run-test-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Test and Deploy

on:
push:
branches-ignore:
- '**'
tags:
- '*'

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Npm install and build
run: |
npm ci
npm run build
- name: Composer install and set phpcs
run: |
composer install
composer phpcs
- name: Running lint check
run: npm run lint

deploy:
name: Deploy to WP.org
runs-on: ubuntu-latest
needs: [ test ]

steps:
- name: Checkout
uses: actions/checkout@main

- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Npm install and build
run: |
npm ci
npm run build
- name: WordPress Plugin Deploy
id: deploy
uses: 10up/action-wordpress-plugin-deploy@stable
with:
generate-zip: true
env:
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SLUG: enable-responsive-image

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
commitish: main

- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.deploy.outputs.zip-path }}
asset_name: ${{ github.event.repository.name }}.zip
asset_content_type: application/zip
35 changes: 35 additions & 0 deletions .github/workflows/run-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test

on:
push:
tags-ignore:
- '**'
branches:
- '*'
pull_request:
branches:
- '*'

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Npm install and build
run: |
npm ci
npm run build
- name: Composer install and set phpcs
run: |
composer install
composer phpcs
- name: Running lint check
run: npm run lint
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.vscode
artifacts/
build/
node_modules/
vendor/
Expand Down

0 comments on commit ea147c8

Please sign in to comment.