Skip to content

Commit

Permalink
preparing release deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
sultann committed Apr 1, 2023
1 parent 4b5fa9c commit 8fab88e
Show file tree
Hide file tree
Showing 20 changed files with 536 additions and 374 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/deploy-plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Deploy Plugin
# When pushing to master or release/* branches

on:
push:
branches:
- master
- release/*
workflow_dispatch:
inputs:
ref:
description: 'The branch to deploy the plugin from'
required: false
default: 'master'
env:
SSH_USER: manik
PHP_VERSION: 7.4
DOMAIN: ${{ github.ref == 'refs/heads/master' && 'trunk.pluginever.com' || 'test.pluginever.com' }}

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ secrets.PHP_VERSION }}
tools: composer

- name: Setup GITHUB token
run: |
composer config -g github-oauth.github.com ${ACCESS_TOKEN}
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}

- name: Build Project
run: |
npm install && npm run build
composer install
composer update --no-dev --no-scripts
shell: bash

- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_KEY }}
config: |
Host *
HostName ${{ secrets.SSH_HOST }}
Port ${{ env.SSH_PORT }}
IdentityFile ~/.ssh/id_rsa
HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedAlgorithms +ssh-rsa
StrictHostKeyChecking no
known_hosts: unnecessary

- name: Deploy at ${{ env.DOMAIN }}
if: github.ref == 'refs/heads/master'
run: |
rsync -avz --delete --no-o --no-g --exclude-from=./.distignore ./ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/home/${{ env.SSH_USER }}/${{ env.DOMAIN }}/wp-content/plugins/wc-serial-numbers
shell: bash

- name: Deploy at ${{ env.DOMAIN }}
if: github.ref != 'refs/heads/master'
run: |
rsync -avz --delete --no-o --no-g --exclude-from=./.distignore ./ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/home/${{ env.SSH_USER }}/${{ env.DOMAIN }}/wp-content/plugins/wc-serial-numbers
shell: bash

# Post message to slack channel
- name: Slack Notification
if: github.ref == 'refs/heads/master'
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: announcement
# Post github commit message to slack
SLACK_COLOR: ${{ job.status }} # or a specific color like 'good' or '#ff00ff'
SLACK_ICON: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png?size=48
SLACK_MESSAGE: "Check it out here: https://${{ env.DOMAIN }}"
SLACK_TITLE: "WooCommerce Serial Numbers Plugin Deployed"
SLACK_USERNAME: deploybot
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_FOOTER: '${{ github.event.head_commit.message }}'
MSG_MINIMAL: true
62 changes: 37 additions & 25 deletions assets/css/admin-style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,43 @@
}
}

//.wcsn-card {
//
// &.card__header {
// border-bottom: 0;
// padding-top: 1em;
//
// h2, h3 {
// margin: 0;
// }
//
// & + .card {
// margin-top: 0;
// }
// }
//
// &.card__header,
// &.card {
// max-width: 100%;
// }
//
// // If there is description text, limit width to the input field.
// .description {
// max-width: 400px;
// }
//}
// Feature promo section.
.wcsn-feature-promo-banner {
background: #fff;
border: 1px solid #c3c4c7;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
margin-top: 20px;
box-sizing: border-box;
max-width: 800px;
position: relative;

> img {
width: 100%;
height: auto;
}

&__content {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
background: rgba(255, 255, 255, 0.7);
transition: opacity 0.3s ease-in-out;

h3 {
color: red;
font-size: 1.5em;
margin: 0 0 1em;
text-align: center;
}
}
}


// Key style.
// Show the serial key in a nice box with a copy button.
Expand Down
Binary file added assets/images/add-generator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/csv-export.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/csv-import.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/txt-import.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8fab88e

Please sign in to comment.