Build Package Repo #9177
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Build Package Repo' | |
on: | |
push: | |
schedule: | |
- cron: '0 8,10,13,16,19,21 * * *' | |
workflow_dispatch: | |
jobs: | |
build-repository: | |
runs-on: ubuntu-latest | |
name: Build packages repository | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Cache composers | |
uses: actions/cache@v2 | |
with: | |
path: | | |
_composer-cache | |
key: ${{ hashFiles('satis*.json') }} | |
- name: Build satis repository | |
uses: ingenerator/[email protected] | |
with: | |
cacheDir: '_composer-cache' | |
githubToken: ${{ secrets.GITHUB_TOKEN }} | |
- name: Store as build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: built-satis-repository | |
path: | | |
satis_output | |
publish-to-github-pages: | |
needs: build-repository | |
if: github.ref == 'refs/heads/master' | |
name: Publish package repo to Github Pages | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch artifacts | |
uses: actions/[email protected] | |
with: | |
name: built-satis-repository | |
path: satis_output | |
- name: Calculate committer name | |
id: committer_name | |
run: | | |
# Publish as the author of the change to the repo if this was a `push` | |
# Or as github actions if this was a dispatch or a scheduled action | |
if [ $GITHUB_EVENT_NAME == 'push' ] | |
then | |
echo "::set-output name=author::$GITHUB_ACTOR" | |
else | |
echo "::set-output name=author::github-actions[bot]" | |
fi | |
- name: Publish to github pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./satis_output | |
cname: php-packages.ingenerator.com | |
user_name: ${{steps.committer_name.outputs.author}} | |
user_email: ${{steps.committer_name.outputs.author}}@users.noreply.github.com |