Skip to content

Moved back installer into the project. #13

Moved back installer into the project.

Moved back installer into the project. #13

# This action is used for Vortex maintenance. It will not be used in the scaffolded project.
name: Vortex - Release docs
on:
push:
tags:
- '*'
branches:
- '**release-docs**'
- '**release-installer**'
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
vortex-release-installer:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
- name: Install dependencies
run: composer install
working-directory: .vortex/installer
- name: Add version
run: |
TAG=${{ github.ref_type == 'tag' && github.ref_name || '' }}
SHA=${{ github.ref_type == 'branch' && github.sha || '' }}
sed -i "s/\"git-tag-ci\": \"dev\"/\"git-tag-ci\": \"${TAG:-${SHA}}\"/g" box.json
working-directory: .vortex/installer
- name: Build PHAR
run: composer build
working-directory: .vortex/installer
- name: Test PHAR
run: ./build/installer --quiet || exit 1
working-directory: .vortex/installer
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: vortex-installer
path: .vortex/installer/build/installer
vortex-release-docs:
needs: vortex-release-installer
environment:
name: github-pages
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
- name: Download installer
uses: actions/download-artifact@v2
with:
name: vortex-installer
- name: Copy installer to docs
run: |
cp ../installer ../.vortex/docs/static/install
php ../.vortex/docs/static/install --version
- name: Check docs up-to-date
run: |
composer --working-dir=.utils install
npm run update-variables
git diff --quiet HEAD || { echo "Docs not up-to-date. Run 'cd .vortex && ahoy update-docs' and commit changes."; git diff; exit 1; }
working-directory: .vortex/docs
- name: Install dependencies
run: npm install
working-directory: .vortex/docs
- name: Build documentation site
run: npm run build
working-directory: .vortex/docs
- name: Upload documentation site
uses: actions/upload-pages-artifact@v3
with:
path: ".vortex/docs/build"
- name: Setup SSH private key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.DOCS_PUBLISH_SSH_PRIVATE_KEY }}
- name: Publish docs
run: |
cd "${GITHUB_WORKSPACE}/.vortex/docs"
export DOCS_PUBLISH_SRC_DIR="${GITHUB_WORKSPACE}/.vortex/docs/build"
export [email protected]:drevops/vortex-docs.git
export DOCS_PUBLISH_COMMIT_MESSAGE="Automatically pushed from drevops/vortex"
export DOCS_PUBLISH_GIT_EMAIL="[email protected]"
./.utils/publish.sh