Skip to content

chore(release): 3.8.1 #112

chore(release): 3.8.1

chore(release): 3.8.1 #112

Workflow file for this run

name: Deploy
on:
push:
tags:
- "*"
jobs:
deploy:
name: Deploy to server
runs-on: ubuntu-latest
env:
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SSH_KEY: ${{ secrets.SSH_KEY }}
SSH_PORT: ${{ secrets.SSH_PORT }}
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_PATH: ${{ secrets.SSH_PATH }}
steps:
- uses: actions/checkout@master
- name: Setup node 14
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Build & create dist/artifact
run: |
yarn install --frozen-lockfile
composer install --no-dev --prefer-dist --no-progress --no-suggest
yarn run build
yarn run dist
- name: Add SSH Key
run: |
mkdir $HOME/.ssh
echo "$SSH_KEY" > "$HOME/.ssh/key"
chmod 600 "$HOME/.ssh/key"
- name: Deploy to server
run: |
rsync -rc --exclude-from="$GITHUB_WORKSPACE/.distignore" -e "ssh -i $HOME/.ssh/key -o StrictHostKeyChecking=no -p $SSH_PORT" "$GITHUB_WORKSPACE/" $SSH_USERNAME@$SSH_HOST:$SSH_PATH
- name: Upload Latest Version to S3
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.S3_AWS_KEY_ARTIFACTS }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_AWS_SECRET_ARTIFACTS }}
AWS_REGION: 'us-west-1' # optional: defaults to us-east-1
SOURCE_DIR: 'artifact' # optional: defaults to entire repository
DEST_DIR: ${{ secrets.AWS_PRODUCTS_FOLDER }}/$BUILD_NAME/latest
- name: Upload Tagged Version to S3
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.S3_AWS_KEY_ARTIFACTS }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_AWS_SECRET_ARTIFACTS }}
AWS_REGION: 'us-west-1' # optional: defaults to us-east-1
SOURCE_DIR: 'artifact' # optional: defaults to entire repository
DEST_DIR: ${{ secrets.AWS_PRODUCTS_FOLDER }}/$BUILD_NAME/$BUILD_VERSION
- name: Send update to the store
env:
THEMEISLE_ID: ${{ secrets.THEMEISLE_ID }}
THEMEISLE_AUTH: ${{ secrets.THEMEISLE_AUTH }}
STORE_URL: ${{ secrets.STORE_URL }}
run: |
if [ ! -z "$THEMEISLE_ID" ]; then
STORE_JSON='{"version": "'$BUILD_VERSION'","id": "'$THEMEISLE_ID'","body": ""}';
echo "$STORE_JSON";
curl -X POST -H 'Cache-Control: no-cache' -H "Content-Type: application/json" -H "x-themeisle-auth: $THEMEISLE_AUTH" --data "$STORE_JSON" "$STORE_URL/wp-json/edd-so/v1/update_changelog/" > /dev/null
fi
- name: WordPress Theme Deploy
uses: Codeinwp/action-wordpress-theme-deploy@primary
env:
SVN_PASSWORD: ${{ secrets.SVN_THEMEISLE_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_THEMEISLE_USERNAME }}