mirror of
https://github.com/torrentpier/torrentpier.git
synced 2025-03-12 04:35:42 -07:00
72 lines
1.9 KiB
YAML
72 lines
1.9 KiB
YAML
name: Continuous Integration
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
nightly:
|
|
name: Nightly builds 📦
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- name: Checkout code 🗳
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup PHP 🔩
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '8.1'
|
|
|
|
- name: Install Composer dependencies 🪚
|
|
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
|
|
|
- name: Get commit hash 🔗
|
|
id: get-commit-hash
|
|
run: |
|
|
COMMIT_HASH=$(git rev-parse --short HEAD)
|
|
echo "COMMIT_HASH=$COMMIT_HASH" >> $GITHUB_OUTPUT
|
|
|
|
- name: Create archive 🗞
|
|
id: create-zip
|
|
run: |
|
|
ZIP_NAME="torrentpier-${{ steps.get-commit-hash.outputs.COMMIT_HASH }}.zip"
|
|
zip -r "$ZIP_NAME" . -x ".git/*" ".github/*"
|
|
echo "ZIP_NAME=$ZIP_NAME" >> $GITHUB_OUTPUT
|
|
|
|
- name: Upload Archive 📤
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: TorrentPier
|
|
path: ${{ steps.create-zip.outputs.ZIP_NAME }}
|
|
|
|
deploy:
|
|
name: 🎉 Deploy
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: 🚚 Get latest code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: 🔩 Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '8.1'
|
|
|
|
- name: 🖇 Install Composer dependencies
|
|
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
|
|
|
- name: 📂 Sync files
|
|
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
|
|
with:
|
|
server: ${{ secrets.FTP_SERVER }}
|
|
username: ${{ secrets.FTP_USERNAME }}
|
|
password: ${{ secrets.FTP_PASSWORD }}
|
|
server-dir: ${{ secrets.FTP_DIR }}
|
|
protocol: ${{ secrets.FTP_PROTOCOL }}
|
|
port: ${{ secrets.FTP_PORT }}
|
|
exclude: |
|
|
**/.git*
|
|
**/.git*/**
|
|
.env
|