WIP: Organisation-wide defaults and reusable GitHub Actions for SciFY repositories.
This repository is public. GitHub requires that for the default files, the profile README and the workflow templates to take effect. Do not commit secrets, hostnames or internal URLs here.
| Path | Purpose | How it reaches other repositories |
|---|---|---|
CONTRIBUTING.md, CODE_OF_CONDUCT.md, SECURITY.md, PULL_REQUEST_TEMPLATE.md, ISSUE_TEMPLATE/ |
Default community health files | Automatic. Applies to every scify repository that has no file of its own. |
profile/README.md |
Organisation profile page | Automatic. Shown on https://github.com/scify. |
workflow-templates/ |
Starter workflows | Actions tab → New workflow → "By SciFY". The developer gets a copy. Only the Laravel CI template exists so far. Node and deploy templates come later. |
.github/workflows/*.yml |
Reusable workflows (workflow_call) |
Called with uses: scify/.github/.github/workflows/<name>[email protected]. One implementation, shared by all callers. |
.github/actions/*/ |
Composite actions | Called as a step with uses: scify/.github/.github/actions/<name>@v0.1. Each folder has its own README. |
templates/dependabot-*.yml |
Dependabot configuration | Manual copy to .github/dependabot.yml. GitHub has no default mechanism for Dependabot. |
| Workflow | For | Inputs of note |
|---|---|---|
laravel-ci.yml |
Laravel repositories | php-version, frontend, build-frontend-for-tests |
node-ci.yml |
npm-only repositories | node-version, working-directory, build-command |
laravel-deploy.yml |
Laravel app to a SciFY server over SSH | environment, php-binary, build-command, extra-exclude, extra-checkout-* |
node-deploy.yml |
Static frontend build to a server over SSH | environment, build-directory, delete-remote-files |
security.yml |
Any repository. Committed .env files, Gitleaks, dev tool configs, npm hardening, composer audit, npm audit |
php-version, npm-audit-level, strict-dev-configs |
license-check.yml |
Opt-in. Allow-list check of Composer and npm production licences. Not for WordPress repositories | allowed-licenses |
owasp-dependency-check.yml |
Opt-in. OWASP Dependency-Check HTML report | fail-on-cvss, secret NVD_API_KEY |
Each file starts with a comment block that lists every input, secret and server requirement.
Laravel repositories:
- Open the repository's Actions tab and click New workflow.
- Pick SciFY Laravel CI under "By SciFY".
- Adjust the inputs in the generated file and commit it.
Or copy workflow-templates/laravel-ci.yml by hand into .github/workflows/ci.yml
and replace $default-branch with main.
npm-only repositories have no template yet. Create .github/workflows/ci.yml with:
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
ci:
uses: scify/.github/.github/workflows/[email protected]-
Create a GitHub environment named
productionin the repository settings. -
Add these environment secrets:
Secret Value SSH_HOSTServer hostname or IP SSH_PORTSSH port. Optional, defaults to 22 SSH_USERDeploy user SSH_PRIVATE_KEYPrivate key of the deploy user PROJECT_PATHAbsolute path of the application on the server ENV_FILEFull content of the production .env. Optional for Laravel: when empty, the.envalready on the server is kept -
Create
.github/workflows/deploy-production.yml. There is no template yet. For Laravel:name: Deploy production on: workflow_dispatch: permissions: contents: read jobs: deploy: uses: scify/.github/.github/workflows/[email protected] with: environment: production secrets: SSH_HOST: ${{ secrets.SSH_HOST }} SSH_PORT: ${{ secrets.SSH_PORT }} SSH_USER: ${{ secrets.SSH_USER }} SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} PROJECT_PATH: ${{ secrets.PROJECT_PATH }} ENV_FILE: ${{ secrets.ENV_FILE }}
For a static frontend, call
node-deploy.ymlinstead with the same secrets. -
Run it from the Actions tab with Run workflow.
Laravel-specific server requirements are listed at the top of .github/workflows/laravel-deploy.yml.
Create .github/workflows/security.yml:
name: Security
on:
pull_request:
schedule:
- cron: '0 11 * * 1'
permissions:
contents: read
jobs:
security:
uses: scify/.github/.github/workflows/[email protected]Every check skips itself when the repository lacks the matching files, so the
same call works for Laravel, npm-only and PHP-only repositories. The npm
hardening check expects the .npmrc described in
.github/actions/verify-npm-hardening/README.md.
Licence and OWASP scans are separate workflows. Add a job that calls
license-check.yml or owasp-dependency-check.yml when a project needs them.
This repository is work in progress. Releases are tagged v0.x and callers
pin to the current one, v0.1. Any v0.x release may change inputs or
defaults. When the workflows have run in real repositories for a while, v1
becomes the first stable tag and moves forward only for backwards-compatible
fixes.
To publish a new release:
-
Update every
@v0.xreference in this repository to the new tag. Thesecurity.ymlworkflow calls the composite actions by tag, so a missing update breaks it. -
Tag and push:
git tag v0.2 && git push origin v0.2
A reusable workflow cannot reference a sibling action by relative path, so
security.yml calls the actions in this repository as
scify/.github/.github/actions/<name>@v0.1. When you test a workflow change on a
branch, the actions still come from v1. Move the tag after both are merged.
Dependabot reads only the repository's own .github/dependabot.yml. There is
no include mechanism, so the templates are copied once and then owned by that
repository. Pick the matching template:
templates/dependabot-laravel.ymlfor Composer + npm + GitHub Actionstemplates/dependabot-node.ymlfor npm + GitHub Actionstemplates/dependabot-wordpress.ymlfor WordPress themes and plugins. Read its header: WordPress core and wp-admin plugins are not tracked.
From the target repository's root:
mkdir -p .github
curl -sSfL https://raw.githubusercontent.com/scify/.github/v0.1/templates/dependabot-laravel.yml -o .github/dependabot.ymlThen enable "Dependabot security updates" in the repository's Security settings and commit the file.
All three templates configure security updates only. A change to a template does not reach existing copies. Re-run the command to pick it up.
- Pin every third-party action to a full commit SHA with the version in a trailing comment.
- Keep reusable workflows tolerant: run a tool only when the repository is configured for it.
- Test a change by pointing a caller at your branch:
uses: scify/.github/.github/workflows/laravel-ci.yml@my-branch. - Run
actionlintbefore you push.