Add Sansec eComscan workflow #31
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: "π - Deploy" | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: "βοΈ - Build and Deploy Website" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "βοΈ - Checkout Website Repo" | |
uses: actions/checkout@v3 | |
with: | |
path: 'devdocs' | |
- name: "π - Setup PHP" | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.1' | |
- name: "π - Install PHP dependencies" | |
run: | | |
cd devdocs | |
composer install --no-progress --prefer-dist --optimize-autoloader | |
- name: "π€‘ - Setup Node.js" | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '19' | |
- name: "𧱠- Install Node dependencies and build assets" | |
run: | | |
cd devdocs | |
npm install | |
npm run build | |
- name: "π¦ - Add Docs to Website" | |
run: | | |
cd devdocs | |
chmod +x ./bin/checkout_latest_docs.sh | |
./bin/checkout_latest_docs.sh | |
- name: "π¦ - Deploy Website" | |
uses: appleboy/scp-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.SSH_KEY }} | |
source: "devdocs/*" | |
target: "/var/www/share/devdocs.mage-os.org/" | |
- name: "πΈ - Extract and setup on server" | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.SSH_KEY }} | |
script: | | |
cd /var/www/share/devdocs.mage-os.org/ | |
rm -Rf htdocs | |
cp shared/.env devdocs/.env | |
ln -s devdocs/public htdocs | |
cd devdocs | |
composer install --no-dev | |
php artisan optimize | |
php artisan sitemap:generate |