-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.yml
More file actions
84 lines (76 loc) · 2.44 KB
/
config.yml
File metadata and controls
84 lines (76 loc) · 2.44 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
# PHP CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-php/ for more details
#
version: 2.1
jobs:
build:
docker:
- image: circleci/php:7.4-node-browsers
steps:
- checkout
- run: sudo apt update
- run: sudo apt install aspell
- run: sudo docker-php-ext-install zip
# Download and cache dependencies
- restore_cache:
keys:
# "composer.lock" can be used if it is committed to the repo
- v1-dependencies-{{ checksum "composer.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run: composer install -n --prefer-dist
- save_cache:
key: v1-dependencies-{{ checksum "composer.json" }}
paths:
- ./vendor
- run: ./test.sh
- run: ./vendor/bin/psalm.phar
- run:
name: Check Sample project
command: |
cd sample-project
composer install
../vendor/bin/psalm.phar
- run: php generate.php
- store_artifacts:
path: generated
- run:
name: Display link to built website
command: |
echo "Generated website available at:"
echo https://circleci.com/api/v1.1/project/github/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BUILD_NUM}/artifacts/0/generated/01-introduction.html
- persist_to_workspace:
root: ~/
paths: project/generated
deploy_ghpages:
docker:
- image: buildpack-deps:trusty
steps:
- checkout # just needed to get the SSH key for github so we can push later
- add_ssh_keys
- attach_workspace:
at: /tmp/workspace
- run:
name: Deploy to GitHub Pages
command: |
find /tmp/workspace
cd ~/project
git checkout gh-pages
mv .git/ /tmp/
find . -mindepth 1 -delete
mv /tmp/.git .
cp -a /tmp/workspace/project/generated/. .
git add --no-ignore-removal .
git config user.email ci@circleci
git config user.name "Circle CI"
git commit -m "Update GH Pages based on CircleCI Build $CIRCLE_BUILD_NUM [ci skip]"
git config --global push.default simple
git push
workflows:
Workflow:
jobs:
- build
- deploy_ghpages:
requires:
- build