File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build and Deploy
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+
8+ permissions :
9+ contents : write
10+
11+ jobs :
12+ build-and-deploy :
13+ runs-on : ubuntu-latest
14+
15+ steps :
16+ - name : Checkout repository
17+ uses : actions/checkout@v4
18+
19+ - name : Build Docker image
20+ run : docker build -t scotlandphp-builder .
21+
22+ - name : Run build in Docker container
23+ run : |
24+ docker run --rm \
25+ -v ${{ github.workspace }}:/app \
26+ -w /app \
27+ scotlandphp-builder \
28+ sh -c "composer install && php vendor/bin/robo build --dist"
29+
30+ - name : Fix permissions
31+ run : sudo chown -R $USER:$USER dist
32+
33+ - name : Deploy to GitHub Pages
34+ run : |
35+ cd dist
36+ echo 'community.scotlandphp.co.uk' > CNAME
37+ git init
38+ git config user.name "github-actions[bot]"
39+ git config user.email "github-actions[bot]@users.noreply.github.com"
40+ git add -A
41+ git commit -m "Deploy to GitHub Pages: ${{ github.sha }}"
42+ git push -f https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:gh-pages
You can’t perform that action at this time.
0 commit comments