Skip to content

Commit

Permalink
improve(deploy): Improve how deployments work #262
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronware committed Sep 1, 2022
1 parent c2bb247 commit e7896af
Show file tree
Hide file tree
Showing 9 changed files with 137 additions and 82 deletions.
2 changes: 1 addition & 1 deletion .deployment/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -eo

TMP_DIR="$GITHUB_WORKSPACE/courier-notices"
TMP_DIR="$GITHUB_WORKSPACE/zip"
mkdir "$TMP_DIR"

# If there's no .gitattributes file, write a default one into place
Expand Down
1 change: 1 addition & 0 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/vendor/dealerdirect
/vendor/phpcompatibility
/vendor/php-parallel-lint

gulpfile.babel.js
yarn.lock
config.yml
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/release-files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
on:
release:
types: [published]

name: Deploy Release Assets

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Get Version From Tag
id: get_version
uses: actions-ecosystem/[email protected]
with:
semver_only: true

- name: Latest Version
id: latest_version
run: |
TAG=${{ steps.get_version.outputs.tag }}
echo ::set-output name=VERSION::${TAG#v}
- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}

- name: Composer Install
uses: php-actions/composer@v6
with:
working_dir: ./
dev: no
php_version: 7.4

- name: Install Yarn Dependencies
run: |
yarn install
yarn build
rm -rf node_modules
- name: Build Plugin UI
run: |
cd ./frontend
yarn install
yarn build
- name: Clean Build Files/Folders
run : |
chmod +x ./.deployment/cleanup.sh
sh ./.deployment/cleanup.sh;
- name: Create Sync Zip
run: |
cd ./zip
zip -r ../courier-notices.zip ./
cd ../
- name: Upload files to a GitHub release
uses: svenstaro/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: courier-notices.zip
tag: ${{ steps.get_version.outputs.tag }}
name: courier-notices.zip
overwrite: true
24 changes: 24 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
push:
branches:
- master

name: release-please
jobs:
release-please:
if: github.event_name != 'pull_request' && github.event.pull_request.merged != true
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
with:
release-type: php
package-name: mantle
bump-minor-pre-major: true
token: ${{ secrets.GH_BOT_TOKEN }}
versioning-strategy: always-bump-patch
extra-files: |
README.md
package.json
courier-notices.php
readme.txt
composer.json
80 changes: 0 additions & 80 deletions .github/workflows/release.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/wiki.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
on:
push:
branches:
- master
tags:
- 'v*'
paths:
- .github/workflows/wiki.yml
- '**.php'

name: Update Wiki

jobs:
update_wiki:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}

- name: Create Wiki Markdown
uses: php-actions/composer@v6

- name: Generate API docs
run: |
wget https://phpdoc.org/phpDocumentor.phar
php phpDocumentor.phar --directory=./application --target=./wiki --template='vendor/saggre/phpdocumentor-markdown/themes/markdown'
- name: Push Wiki Changes
uses: Andrew-Chen-Wang/github-wiki-action@v3
env:
# Make sure you have that / at the end. We use rsync
# WIKI_DIR's default is wiki/
WIKI_DIR: wiki/
GH_TOKEN: ${{ secrets.GH_WIKI_UPDATE_TOKEN }}
GH_MAIL: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
GH_NAME: ${{ github.repository_owner }}
3 changes: 2 additions & 1 deletion .phplint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ extensions:
- php
exclude:
- vendor
warning: true
- github/workspace/vendor/
warning: false
2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
nodeLinker: node-modules
pnpFallbackMode: none
1 change: 1 addition & 0 deletions wiki/Home.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Elite Product

0 comments on commit e7896af

Please sign in to comment.