Build and Release #24
Workflow file for this run
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: Build and Release | |
on: | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup PHP version | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '7.4' | |
- name: Get composer cache directory | |
id: composer-cache | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Install dependencies | |
if: steps.composer-cache.outputs.cache-hit != 'true' | |
run: composer install --prefer-dist --no-progress --no-suggest --ignore-platform-reqs --no-dev --optimize-autoloader | |
- name: Add vendor | |
if: steps.composer-cache.outputs.cache-hit != 'true' | |
run: | | |
rm -rf .gitignore | |
git config --global user.email "[email protected]" | |
git config --global user.name "yrccondor" | |
git add . | |
git commit -m "Add vendor" | |
- name: WordPress Plugin Deploy | |
id: deploy | |
uses: 10up/[email protected] | |
with: | |
generate-zip: true | |
env: | |
SVN_USERNAME: ${{ secrets.SVN_USERNAME }} | |
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} | |
- name: Upload release asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ${{github.workspace}}/${{ github.event.repository.name }}.zip | |
asset_name: ${{ github.event.repository.name }}.zip | |
asset_content_type: application/zip |