Skip to content

Updates screenshot workflow #98

Updates screenshot workflow

Updates screenshot workflow #98

Workflow file for this run

name: Screenshots
on:
push:
branches:
- master
paths:
- ".github/workflows/screenshots.yml"
- "app/templates/**"
jobs:
test:
runs-on: macos-latest
strategy:
matrix:
node-version: [16.14.0]
pandoc-version: [3.1.1]
redis-version: [6.2.6]
environment: Tests
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Pandoc on macos
run: |
mkdir -p data/pandoc
cd data/pandoc
wget https://github.com/jgm/pandoc/releases/download/${{ matrix.pandoc-version }}/pandoc-${{ matrix.pandoc-version }}-macOS.zip -O pandoc.zip
unzip pandoc.zip
export BLOT_PANDOC_PATH=$(pwd)/pandoc-3.1.1/bin/pandoc
echo "BLOT_PANDOC_PATH=$(pwd)/pandoc-3.1.1/bin/pandoc" >> $GITHUB_ENV
$BLOT_PANDOC_PATH --version
cd ../..
- name: Use dnsmasq to resolve blot.development
run: |
brew install kubernetes-cli dnsmasq
export LOCAL_CUSTOM_TLD="blot.development"
echo "address=/.${LOCAL_CUSTOM_TLD}/127.0.0.1" >> $(brew --prefix)/etc/dnsmasq.conf
sudo mkdir /etc/resolver/
cat <<EOF | sudo tee /etc/resolver/${LOCAL_CUSTOM_TLD}
nameserver 127.0.0.1
EOF
sudo brew services restart dnsmasq
sudo killall -HUP mDNSResponder
scutil --dns
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Set up Redis
run: |
brew install redis
brew services start redis
- name: Configure and start Nginx reverse proxy
run: |
brew install nginx
sudo tee /opt/homebrew/etc/nginx/nginx.conf <<EOF
events { }
http {
server {
listen 80;
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host \$host;
proxy_set_header X-Real-IP \$remote_addr;
}
}
}
EOF
sudo nginx
- name: Install Dependencies
run: npm ci
- name: Take screenshots
env:
BLOT_CACHE: false
BLOT_DEBUG: false
BLOT_MAINTENANCE: false
BLOT_PRODUCTION: true
BLOT_PROTOCOL: http
BLOT_ENVIRONMENT: development
BLOT_HOST: blot.development
BLOT_ADMIN_EMAIL: ${{ secrets.BLOT_ADMIN_EMAIL }}
BLOT_DROPBOX_APP_SECRET: ${{ secrets.BLOT_DROPBOX_APP_SECRET }}
BLOT_DROPBOX_FULL_SECRET: ${{ secrets.BLOT_DROPBOX_FULL_SECRET }}
BLOT_DROPBOX_TEST_ACCOUNT_APP_TOKEN: ${{ secrets.BLOT_DROPBOX_TEST_ACCOUNT_APP_TOKEN }}
BLOT_DROPBOX_TEST_ACCOUNT_FULL_TOKEN: ${{ secrets.BLOT_DROPBOX_TEST_ACCOUNT_FULL_TOKEN }}
BLOT_DROPBOX_TEST_ACCOUNT_ID: ${{ secrets.BLOT_DROPBOX_TEST_ACCOUNT_ID }}
BLOT_MAILGUN_KEY: ${{ secrets.BLOT_MAILGUN_KEY }}
BLOT_SESSION_SECRET: ${{ secrets.BLOT_SESSION_SECRET }}
BLOT_TWITTER_ACCESS_TOKEN_KEY: ${{ secrets.BLOT_TWITTER_ACCESS_TOKEN_KEY }}
BLOT_TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.BLOT_TWITTER_ACCESS_TOKEN_SECRET }}
BLOT_TWITTER_CONSUMER_KEY: ${{ secrets.BLOT_TWITTER_CONSUMER_KEY}}
BLOT_TWITTER_CONSUMER_SECRET: ${{ secrets.BLOT_TWITTER_CONSUMER_SECRET}}
BLOT_REDIS_HOST: 127.0.0.1
run: |
export BLOT_DIRECTORY=$(pwd)
export NODE_PATH=$(pwd)/app
export BLOT_CACHE_DIRECTORY=$(pwd)/cache
node app/templates/index.js --no-watch
node app/index.js &
node app/templates/folders/index.js
node app/templates/screenshots.js
- name: Commit changes and create pull request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Using latest folders in app/templates
title: Update screenshots
body: This pull request updates the screenshots of the folders and templates
branch: update-screenshots