Deployment #75
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: "Deployment" | |
on: | |
pull_request: | |
types: | |
- closed | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash -l {0} | |
jobs: | |
Automation: | |
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Cancel similar actions in progress" | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- name: "Install Node" | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
#cache: 'npm' | |
- name: "Install Sass" | |
run: | | |
npm install -g sass | |
npm install -g html-minifier | |
npm install -g clean-css | |
npm install -g clean-css-cli | |
- name: "Install Imagemagick" | |
run: | | |
sudo apt-get update | |
sudo apt-get install imagemagick | |
- name: "Install Ruby" | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.3 | |
bundler-cache: true | |
- name: "Install gems" | |
run: | | |
gem install commonmarker | |
- name: "Setup Arturo" | |
uses: arturo-lang/arturo-action@main | |
- name: "Checkout" | |
uses: actions/checkout@main | |
with: | |
submodules: recursive | |
- name: Update package info | |
run: | | |
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH | |
arturo tools/deploy.art | |
rm -rf public | |
mkdir public | |
arturo tools/generateweb.art | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish changes | |
uses: EndBug/add-and-commit@v9 | |
with: | |
author_name: drkameleon | |
author_email: [email protected] | |
message: 'CI Package Deployment' | |
add: '.' | |
- name: Update registry | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USER }} | |
key: ${{ secrets.SSH_KEY }} | |
script: | | |
cd /var/www/pkgr.art | |
git reset --hard | |
git pull | |
sudo chown -R www-data:www-data /var/www/pkg_stats | |
sudo chmod -R 777 /var/www/pkg_stats |