Skip to content

Commit e05c8a6

Browse files
authored
Create github action (#77)
* Create gh action On push: lint and test On push to master branch (basically on merging a PR): build and publish by copying files from dist to docs and adding CNAME
1 parent 6879fd5 commit e05c8a6

File tree

4 files changed

+672
-606
lines changed

4 files changed

+672
-606
lines changed

.github/workflows/pull_request.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Pull request
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
Deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v2
15+
16+
- name: Use Node.js
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: '12.x'
20+
21+
- name: Run npm install
22+
run: npm ci
23+
24+
# After the site is built, we delete the old docs folder,
25+
# add CNAME file to dist folder, and rename it to docs.
26+
- name: Build
27+
run: |
28+
npm run build
29+
echo "chooser-beta.creatovecommons.org" > "./dist/CNAME"
30+
rm -r -f "./docs"
31+
mv -f -v "./dist" "./docs"
32+
33+
- name: Commit changes
34+
uses: EndBug/add-and-commit@v4
35+
with:
36+
author_name: obulat
37+
author_email: obulat@gmail.com
38+
message: "Publish site"
39+
add: "./docs"
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/push.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Push
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v2
12+
13+
- name: Use Node.js
14+
uses: actions/setup-node@v1
15+
with:
16+
node-version: '12.x'
17+
- name: Run npm install
18+
run: npm ci
19+
20+
- name: Lint
21+
run: npm run lint
22+
23+
- name: Test
24+
run: npm run test:unit
25+
env:
26+
CI: true

tests/unit/specs/components/__snapshots__/LicenseDetailsCard.spec.js.snap

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ exports[`LicenseDetailsCard.vue Check if the LicenseDetailsCard.vue component ha
77
</h3>
88
<h4 class="vocab b-header"><a href="https://creativecommons.org/licenses/by-sa/4.0/?ref=ccchooser" class="license-name">
99
Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
10-
<a href="https://creativecommons.org/licenses/by-sa/4.0/?ref=ccchooser" target="_blank" rel="noopener noreferrer" class="photo-license-icons"><img alt="CC icon" title="CC icon" src="../assets/license-icons/cc_icon.svg" class="photo-license-icon"> <img alt="by icon" title="by icon" src="[object Object]" class="photo-license-icon"><img alt="sa icon" title="sa icon" src="[object Object]" class="photo-license-icon"></a></a></h4>
10+
<a href="https://creativecommons.org/licenses/by-sa/4.0/?ref=ccchooser" target="_blank" rel="noopener noreferrer" class="photo-license-icons"><img alt="CC icon" title="CC icon" src="../assets/license-icons/cc.svg" class="photo-license-icon"> <img alt="by icon" title="by icon" src="[object Object]" class="photo-license-icon"><img alt="sa icon" title="sa icon" src="[object Object]" class="photo-license-icon"></a></a></h4>
1111
<p class="chooser-selected-description"><b>CC-BY-SA</b>
1212
license-details-card.full-description.cc-by-sa
1313
</p>
@@ -17,8 +17,8 @@ exports[`LicenseDetailsCard.vue Check if the LicenseDetailsCard.vue component ha
1717
</span></li>
1818
<li class="license-list-item sa"><span class="readable-string"><b>SA:</b>
1919
license-details-card.item-description.sa
20-
</span></li>
21-
</span></ul>
20+
</span></li></span>
21+
</ul>
2222
</section>
2323
</div>
2424
`;

0 commit comments

Comments
 (0)