Skip to content

Commit

Permalink
v0.0.1: Alpha Release Version
Browse files Browse the repository at this point in the history
  • Loading branch information
bd-viget committed Jan 22, 2025
1 parent 093ecfe commit 318220f
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 4 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Build and Deploy

on:
push:
branches:
- main

concurrency:
group: deploy
cancel-in-progress: true

jobs:
build_deploy:
name: Build and Deploy
runs-on: ubuntu-latest
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup SSH key and known_hosts
run: |
mkdir -p -m 700 ~/.ssh
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.DEPLOY_KEY }}"
ssh-keyscan ${{ secrets.DEPLOY_TARGET }} >> ~/.ssh/known_hosts
ssh-keyscan ${{ secrets.DEPLOY_KIT_TARGET }} >> ~/.ssh/known_hosts
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20

# Set up composer caching
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}

# Build Blocks Toolkit
- name: Build Form Blocks plugin
run: |
npm ci
npm run build
working-directory: wp-content/plugins/viget-form-blocks

# Deploy code
- name: Deploy Sandbox
run: |
ssh ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_TARGET }} "\
sudo chown -R ${{ secrets.DEPLOY_USER }}:${{ secrets.DEPLOY_DAEMON }} ${{ secrets.APP_PATH }}/wp-content &&\
sudo rm -rf ${{ secrets.APP_PATH }}/wp-content/plugins/viget-form-blocks &&\
rsync -rlptzv --exclude="node_modules" ./wp-content/ ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_TARGET }}:${{ secrets.APP_PATH }}/wp-content/
ssh ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_TARGET }} "\
sudo chown -R ${{ secrets.DEPLOY_USER }}:${{ secrets.DEPLOY_DAEMON }} ${{ secrets.APP_PATH }}/wp-content &&\
sudo chown -R ${{ secrets.DEPLOY_DAEMON }}:${{ secrets.DEPLOY_DAEMON }} ${{ secrets.APP_PATH }}/wp-content/plugins"
- name: Deploy Parts Kit
run: |
ssh ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_KIT_TARGET }} "\
sudo chown -R ${{ secrets.DEPLOY_USER }}:${{ secrets.DEPLOY_DAEMON }} ${{ secrets.APP_PATH }}/wp-content &&\
sudo rm -rf ${{ secrets.APP_PATH }}/wp-content/plugins/viget-form-blocks &&\
rsync -rlptzv --exclude="node_modules" ./wp-content/ ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_KIT_TARGET }}:${{ secrets.APP_PATH }}/wp-content/
ssh ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_KIT_TARGET }} "\
sudo chown -R ${{ secrets.DEPLOY_USER }}:${{ secrets.DEPLOY_DAEMON }} ${{ secrets.APP_PATH }}/wp-content &&\
sudo chown -R ${{ secrets.DEPLOY_DAEMON }}:${{ secrets.DEPLOY_DAEMON }} ${{ secrets.APP_PATH }}/wp-content/plugins"
29 changes: 29 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Create Release

on:
push:
tags:
- 'v*' # Create release for any tag starting with 'v'

concurrency:
group: release
cancel-in-progress: true

jobs:
release:
name: Create GitHub Release
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Create GitHub Release
run: |
gh release create "$TAG" --verify-tag \
--title "$TAG: $(date '+%Y-%m-%d')" \
--generate-notes \
--latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ github.ref_name }}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "viget/viget-form-blocks",
"version": "1.0.0",
"version": "0.0.1",
"description": "Create forms in Gutenberg with ACF Blocks by Viget.",
"keywords": [
"wordpress",
Expand Down
2 changes: 1 addition & 1 deletion packages.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"package": {
"name": "viget/viget-form-blocks",
"version": "1.0.0",
"version": "0.0.1",
"source": {
"url": "/root/path/not/relative/path/to/viget-form-blocks/.git",
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions viget-form-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Viget Form Blocks
* Plugin URI: https://viget.com
* Description: Create forms in Gutenberg with ACF Blocks by Viget.
* Version: 1.0.0
* Version: 0.0.1
* Requires at least: 5.7
* Requires PHP: 8.1
* Requires Plugins: advanced-custom-fields-pro, viget-blocks-toolkit
Expand All @@ -18,7 +18,7 @@
*/

// Plugin version.
const VGTFB_VERSION = '1.0.0';
const VGTFB_VERSION = '0.0.1';

// Plugin path.
define( 'VGTFB_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
Expand Down

0 comments on commit 318220f

Please sign in to comment.