Skip to content

Deploy

Deploy #82

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
STARS=$(curl -s -H "Authorization: Bearer $GH_TOKEN" https://api.github.com/repos/tempestphp/tempest-framework | jq '.stargazers_count // empty')
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"
echo "Latest version: $TAG"
echo "stars=$STARS" >> "$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 }}