Skip to content

Commit 7fb53ec

Browse files
authored
Merge pull request #964 from phpDocumentor/docs-workflow
[TASK] Add documentation building workflow steps
2 parents 681eea9 + 77d9ac2 commit 7fb53ec

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/workflows/documentation.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,56 @@ jobs:
4242

4343
- name: "Run guides-cli"
4444
run: "vendor/bin/guides -vvv --no-progress docs --output='/tmp/test' --fail-on-log"
45+
46+
build:
47+
name: "Documentation"
48+
if: "${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}"
49+
runs-on: "ubuntu-latest"
50+
steps:
51+
- name: "Checkout"
52+
uses: "actions/checkout@v4"
53+
54+
- name: "Build"
55+
uses: "phpDocumentor/phpDocumentor@master"
56+
57+
- name: "Upload"
58+
uses: "actions/upload-artifact@v4"
59+
with:
60+
name: "documentation"
61+
path: "build/docs"
62+
retention-days: 1
63+
64+
deploy:
65+
name: "Deploy"
66+
if: "${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}"
67+
runs-on: "ubuntu-latest"
68+
needs: "build"
69+
steps:
70+
- name: "Checkout"
71+
uses: "actions/checkout@v4"
72+
with:
73+
repository: "phpDocumentor/docs"
74+
token: "${{ secrets.BOT_TOKEN }}"
75+
path: "docs"
76+
77+
- name: "Download"
78+
uses: "actions/download-artifact@v4"
79+
with:
80+
name: "documentation"
81+
path: "build/docs"
82+
83+
- name: "Copy files"
84+
run: "rsync -r --delete build/docs/* docs/docs/components/guides"
85+
86+
- name: "Commit"
87+
uses: "stefanzweifel/git-auto-commit-action@v5"
88+
with:
89+
repository: "docs"
90+
commit_message: "Update guides documentation"
91+
92+
- name: "Push"
93+
uses: "ad-m/github-push-action@master"
94+
with:
95+
directory: "docs"
96+
github_token: "${{ secrets.BOT_TOKEN }}"
97+
repository: "phpDocumentor/docs"

0 commit comments

Comments
 (0)