Skip to content

Commit 34b8b01

Browse files
committed
scaffold project
1 parent a07ab64 commit 34b8b01

14 files changed

+1221
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: delete_development
2+
on:
3+
workflow_dispatch:
4+
env:
5+
COMPONENT_NAME: 'ilw-video' # set this to the web component name you are using
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Configure AWS Credentials
11+
uses: aws-actions/configure-aws-credentials@v1
12+
with:
13+
aws-access-key-id: ${{ vars.TOOLKIT_AWS_ACCESS_KEY }}
14+
aws-secret-access-key: ${{ secrets.TOOLKIT_AWS_ACCESS_SECRET }}
15+
aws-region: us-east-2
16+
- name: Delete S3 bucket
17+
run: aws s3 rm s3://dev.toolkit.illinois.edu/content/$COMPONENT_NAME --recursive
18+
- name: Invalidate Cloudfront cache
19+
run: aws cloudfront create-invalidation --distribution-id ${{ vars.TOOLKIT_AWS_CLOUDFRONT_DEV }} --paths "/$COMPONENT_NAME*"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: deploy_development
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
description: 'Version number'
7+
required: true
8+
default: ''
9+
type: string
10+
env:
11+
MAJORVERSION: ''
12+
COMPONENT_NAME: 'ilw-video' # set this to the web component name you are using
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: 'Checkout GitHub Action'
18+
uses: actions/checkout@v4
19+
- name: Get version from input
20+
run: echo "VERSION=${GITHUB_BRANCH}" >> $GITHUB_ENV
21+
env:
22+
GITHUB_BRANCH: ${{ github.event.inputs.version }}
23+
- name: Display version install
24+
run: echo "Installing dev version ${VERSION}"
25+
26+
- run: npm install
27+
- run: npm rebuild
28+
- run: npm run-script build
29+
- name: Configure AWS Credentials
30+
uses: aws-actions/configure-aws-credentials@v1
31+
with:
32+
aws-access-key-id: ${{ vars.TOOLKIT_AWS_ACCESS_KEY }}
33+
aws-secret-access-key: ${{ secrets.TOOLKIT_AWS_ACCESS_SECRET }}
34+
aws-region: us-east-2
35+
- name: Deploy toolbox to S3 bucket
36+
run: aws s3 sync ./dist/ s3://dev.toolkit.illinois.edu/content/$COMPONENT_NAME/$VERSION --delete --acl bucket-owner-full-control
37+
- name: Invalidate Cloudfront cache
38+
run: aws cloudfront create-invalidation --distribution-id ${{ vars.TOOLKIT_AWS_CLOUDFRONT_DEV }} --paths "/$COMPONENT_NAME/$VERSION*"
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: deploy_production
2+
on:
3+
push:
4+
tags: [ '**' ]
5+
env:
6+
MAJORVERSION: ''
7+
MINORVERSION: ''
8+
FULLVERSION: ''
9+
COMPONENT_NAME: 'ilw-video' # set this to the web component name you are using
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: 'Checkout GitHub Action'
15+
uses: actions/checkout@v4
16+
- name: 'Get Version'
17+
id: get_version
18+
uses: battila7/get-version-action@v2
19+
20+
- name: 'Check for correct naming convention'
21+
if: ${{ !steps.get_version.outputs.is-semver }}
22+
run: exit 1
23+
- name: 'Get major version from tag'
24+
run: echo "MAJORVERSION=${GITHUB_BRANCH}" >> $GITHUB_ENV
25+
env:
26+
GITHUB_BRANCH: ${{ steps.get_version.outputs.major }}
27+
- name: 'Get minor version from tag'
28+
run: echo "MINORVERSION=${GITHUB_BRANCH}.${GITHUB_BRANCH_MINOR}" >> $GITHUB_ENV
29+
env:
30+
GITHUB_BRANCH: ${{ steps.get_version.outputs.major }}
31+
GITHUB_BRANCH_MINOR: ${{ steps.get_version.outputs.minor }}
32+
- name: Get patch (full) version from tag
33+
run: echo "FULLVERSION=${GITHUB_BRANCH}" >> $GITHUB_ENV
34+
env:
35+
GITHUB_BRANCH: ${{ steps.get_version.outputs.version-without-v }}
36+
- name: Display major version install
37+
run: echo "Installing major version ${MAJORVERSION}"
38+
- name: Display minor version install
39+
run: echo "Installing minor version ${MINORVERSION}"
40+
- name: Display patch (full) version install
41+
run: echo "Installing patch (full) version ${FULLVERSION}"
42+
43+
- run: npm install
44+
- run: npm rebuild
45+
- run: npm run-script build
46+
- name: Configure AWS Credentials
47+
uses: aws-actions/configure-aws-credentials@v1
48+
with:
49+
aws-access-key-id: ${{ vars.TOOLKIT_AWS_ACCESS_KEY }}
50+
aws-secret-access-key: ${{ secrets.TOOLKIT_AWS_ACCESS_SECRET }}
51+
aws-region: us-east-2
52+
53+
- name: Deploy toolbox to S3 bucket for major version
54+
run: aws s3 sync ./dist/ s3://cdn.toolkit.illinois.edu/content/$COMPONENT_NAME/$MAJORVERSION --delete --acl bucket-owner-full-control
55+
- name: Invalidate Cloudfront cache for major version
56+
run: aws cloudfront create-invalidation --distribution-id ${{ vars.TOOLKIT_AWS_CLOUDFRONT }} --paths "/$COMPONENT_NAME/$MAJORVERSION*"
57+
- name: Deploy toolbox to S3 bucket for minor version
58+
run: aws s3 sync ./dist/ s3://cdn.toolkit.illinois.edu/content/$COMPONENT_NAME/$MINORVERSION --delete --acl bucket-owner-full-control
59+
- name: Invalidate Cloudfront cache for minor version
60+
run: aws cloudfront create-invalidation --distribution-id ${{ vars.TOOLKIT_AWS_CLOUDFRONT }} --paths "/$COMPONENT_NAME/$MINORVERSION*"
61+
- name: Deploy toolbox to S3 bucket for patch (full) version
62+
run: aws s3 sync ./dist/ s3://cdn.toolkit.illinois.edu/content/$COMPONENT_NAME/$FULLVERSION --delete --acl bucket-owner-full-control
63+
- name: Invalidate Cloudfront cache for patch (full) version
64+
run: aws cloudfront create-invalidation --distribution-id ${{ vars.TOOLKIT_AWS_CLOUDFRONT }} --paths "/$COMPONENT_NAME/$FULLVERSION*"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: deploy_production_manual
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
description: 'Version number'
7+
required: true
8+
default: ''
9+
type: string
10+
env:
11+
MAJORVERSION: ''
12+
MINORVERSION: ''
13+
FULLVERSION: ''
14+
COMPONENT_NAME: 'ilw-video' # set this to the web component name you are using
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: 'Checkout GitHub Action'
20+
uses: actions/checkout@v4
21+
- name: Get version from input
22+
run: echo "VERSION=${GITHUB_BRANCH}" >> $GITHUB_ENV
23+
env:
24+
GITHUB_BRANCH: ${{ github.event.inputs.version }}
25+
- name: Display version install
26+
run: echo "Installing dev version ${VERSION}"
27+
28+
- run: npm install
29+
- run: npm rebuild
30+
- run: npm run-script build
31+
- name: Configure AWS Credentials
32+
uses: aws-actions/configure-aws-credentials@v1
33+
with:
34+
aws-access-key-id: ${{ vars.TOOLKIT_AWS_ACCESS_KEY }}
35+
aws-secret-access-key: ${{ secrets.TOOLKIT_AWS_ACCESS_SECRET }}
36+
aws-region: us-east-2
37+
38+
- name: Deploy toolbox to S3 bucket for version
39+
run: aws s3 sync ./dist/ s3://cdn.toolkit.illinois.edu/content/$COMPONENT_NAME/$VERSION --delete --acl bucket-owner-full-control
40+
- name: Invalidate Cloudfront cache for version
41+
run: aws cloudfront create-invalidation --distribution-id ${{ vars.TOOLKIT_AWS_CLOUDFRONT }} --paths "/$COMPONENT_NAME/$VERSION*"

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
# ilw-video
2+
23
Video component for Illinois Toolkit.
4+
5+
See [toolkit management issue #23](https://github.com/web-illinois/toolkit-management/issues/23).
6+
7+
This is not the video-feature, just a way to box a youtube video or mediaspace video.

builder/ilw-video.0.0.0.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"title": "Video",
3+
"tag": "ilw-video",
4+
"github": "https://github.com/web-illinois/ilw-video/",
5+
"type": "web component",
6+
"element-name": "ilw-video",
7+
"description": "The Video component is not the video-feature, just a way to box a youtube video or mediaspace video.",
8+
"version": "0.0.0",
9+
"date": "7/8/2024",
10+
"css": "https://dev.toolkit.illinois.edu/ilw-video/0.0.0/ilw-video.css",
11+
"js": "https://dev.toolkit.illinois.edu/ilw-video/0.0.0/ilw-video.js",
12+
"production": false,
13+
"notes": "",
14+
"parent-style": "",
15+
"samples": [],
16+
"attributes-fixed": [],
17+
"attributes-text": [],
18+
"attributes": [],
19+
"classes-fixed": [],
20+
"classes": [],
21+
"css-variables": []
22+
}

builder/ilw-video.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"title": "Video",
3+
"tag": "ilw-video",
4+
"github": "https://github.com/web-illinois/ilw-video/",
5+
"type": "web component",
6+
"element-name": "ilw-video",
7+
"description": "The Video component is not the video-feature, just a way to box a youtube video or mediaspace video.",
8+
"toolkit-version": "",
9+
"production-version": "",
10+
"development-version": "0.0.0"
11+
}

index.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!doctype html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Video Component</title>
8+
<link rel="stylesheet" href="https://cdn.brand.illinois.edu/illinois.css">
9+
<link rel="stylesheet" href="https://dev.toolkit.illinois.edu/ilw-global/3.0.0-alpha/ilw-global.css">
10+
<script type="module" src="/src/ilw-video.js"></script>
11+
</head>
12+
13+
<body>
14+
<main>
15+
<h1>Video Component</h1>
16+
17+
<ilw-video></ilw-video>
18+
</main>
19+
</body>
20+
21+
</html>

0 commit comments

Comments
 (0)