Skip to content

Deploy

Deploy #54

Workflow file for this run

name: Deploy
on:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_KEY }}
known_hosts: 'just-a-placeholder-so-we-dont-get-errors'
- name: Adding Known Hosts
run: ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
- name: Install dependencies
run: |
composer update
npm i
- name: List Installed Dependencies
run: composer show -D
- name: Get latest GitHub Statistics
id: stats
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e
# Get stargazers
STARS=$(curl -s -H "Authorization: Bearer $GH_TOKEN" https://api.github.com/repos/tempestphp/tempest-framework | jq '.stargazers_count // empty')
STARS_K=""
if [ -n "$STARS" ]; then
if [ "$STARS" -gt 999 ]; then
STARS_K=$(awk "BEGIN { printf \"%.1fK\", $STARS/1000 }")
else
STARS_K=$STARS
fi
fi
# Get latest release tag
TAG=$(curl -s -H "Authorization: Bearer $GH_TOKEN" https://api.github.com/repos/tempestphp/tempest-framework/releases/latest | jq -r '.tag_name // empty')
echo "Stars: $STARS_K"
echo "Latest Version: $TAG"
# Push these values to the output
echo "stars=$STARS_K" >> "$GITHUB_OUTPUT"
echo "latest_tag=$TAG" >> "$GITHUB_OUTPUT"
- name: Deploy
run: php ./tempest deploy
env:
TEMPEST_BUILD_STARGAZERS: ${{ steps.stats.outputs.stars }}
TEMPEST_BUILD_LATEST_RELEASE: ${{ steps.stats.outputs.latest_tag }}