-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (62 loc) · 2.01 KB
/
build-repository.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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