Skip to content

Commit

Permalink
Add CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
heyhippari committed Mar 13, 2021
1 parent abe137d commit 5b8c306
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 39 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/build_and_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build & release

on:
push:
branches:
- master

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "14"
- name: Install build dependencies
run: npm install svgo
- name: Create dist directory
run: mkdir dist
- name: Copy source SVGs
run: cp -r studios dist/
- name: Optimize source SVGs
run: npx svgo --multipass dist/studios/**/*.svg
- name: ImageMagick Action
uses: jruipinto/ImageMagick-action@v1
with:
# ImageMagick command to be executed
command: mogrify -format webp dist/studios/**/*.svg
- name: Build studios.json
run: jq -s '.[0]=([.[]]|flatten)|.[0]' studios/**/studio.json > dist/studios.json
- name: Remove individual JSON files
run: rm dist/studios/**/studio.json
- name: Compress built assets
run: cd dist; zip -r -D ../release.zip *; cd ..
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: false
files: |
release.zip
2 changes: 1 addition & 1 deletion .github/workflows/validate_json.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Validate studios JSON file
name: Validate JSON files

on:
pull_request:
Expand Down
38 changes: 0 additions & 38 deletions studios.json

This file was deleted.

15 changes: 15 additions & 0 deletions studios/e/studio.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[
{
"name": "E!",
"machine-name": "e",
"providers": {
"tvdb": "87",
"tmdb": "76",
"imdb": "co0022548"
},
"artwork": {
"primary": ["svg", "webp"],
"thumb": ["svg", "webp"]
}
}
]
14 changes: 14 additions & 0 deletions studios/game-show-network/studio.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"name": "Game Show Network",
"machine-name": "game-show-network",
"providers": {
"tvdb": "116",
"tmdb": "63"
},
"artwork": {
"primary": ["svg", "webp"],
"thumb": ["svg", "webp"]
}
}
]
16 changes: 16 additions & 0 deletions studios/netflix/studio.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[
{
"name": "Netflix",
"machine-name": "netflix",
"providers": {
"tvdb": "535",
"tmdb": "213",
"imdb": "co0144901",
"anidb": "54015"
},
"artwork": {
"primary": ["svg", "webp"],
"thumb": ["svg", "webp"]
}
}
]

0 comments on commit 5b8c306

Please sign in to comment.