-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from mishamyrt/develop
Release 1.4.0
- Loading branch information
Showing
33 changed files
with
3,791 additions
and
1,111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
## Feature description | ||
|
||
Short description for the feature. You can add screenshots for clarity. | ||
|
||
### Use cases | ||
|
||
Use cases for the feature. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Build `dev` image | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
build_static: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Build static files | ||
run: npm run build | ||
- name: Upload results | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: dist | ||
path: dist/ | ||
|
||
build_image: | ||
needs: build_static | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Download build results | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: dist | ||
- name: Login to GitHub Docker registry | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_PAT }} | ||
run: echo -n $GITHUB_PAT | docker login docker.pkg.github.com -u $GITHUB_ACTOR --password-stdin | ||
- name: Build image | ||
run: docker build -t docker.pkg.github.com/$GITHUB_REPOSITORY/site:dev -f docker/Dockerfile ./dist | ||
- name: Push image | ||
run: docker push docker.pkg.github.com/$GITHUB_REPOSITORY/site:dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Build fixed version tag image | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
build_static: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Build static files | ||
run: npm run build | ||
- name: Upload results | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: dist | ||
path: dist/ | ||
|
||
build_image: | ||
needs: build_static | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Download build results | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: dist | ||
- name: Login to GitHub Docker registry | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_PAT }} | ||
run: echo -n $GITHUB_PAT | docker login docker.pkg.github.com -u $GITHUB_ACTOR --password-stdin | ||
- name: Build tagged image | ||
run: | | ||
export VERSION="${GITHUB_REF/refs\/tags\/v/}" | ||
docker build -t docker.pkg.github.com/$GITHUB_REPOSITORY/site:$VERSION -f docker/Dockerfile ./dist | ||
docker push docker.pkg.github.com/$GITHUB_REPOSITORY/site:$VERSION | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
name: Deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build_static: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Build static files | ||
run: npm run build | ||
- name: Upload results | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: dist | ||
path: dist/ | ||
|
||
build_image: | ||
needs: build_static | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Download build results | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: dist | ||
- name: Login to GitHub Docker registry | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_PAT }} | ||
run: echo -n $GITHUB_PAT | docker login docker.pkg.github.com -u $GITHUB_ACTOR --password-stdin | ||
- name: Build image | ||
run: docker build -t docker.pkg.github.com/$GITHUB_REPOSITORY/site:latest -f docker/Dockerfile ./dist | ||
- name: Push image | ||
run: docker push docker.pkg.github.com/$GITHUB_REPOSITORY/site:latest | ||
|
||
|
||
deploy_image: | ||
needs: build_image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Deploy latest image to myrt.co | ||
env: | ||
SSH_PRIVATE_KEY_B64: ${{ secrets.SSH_PRIVATE_KEY_B64 }} | ||
GITHUB_PAT: ${{ secrets.GITHUB_PAT }} | ||
run: | | ||
eval $(ssh-agent -s) | ||
echo $SSH_PRIVATE_KEY_B64 | base64 -d | tr -d '\r' > private.key | ||
echo >> private.key | ||
chmod 600 private.key | ||
cat private.key | ssh-add - | ||
mkdir -p ~/.ssh | ||
touch ~/.ssh/known_hosts | ||
chmod 700 ~/.ssh | ||
chmod 644 ~/.ssh/known_hosts | ||
ssh-keyscan -t rsa myrt.co >> ~/.ssh/known_hosts | ||
ansible-playbook -i ansible/hosts ansible/deploy.yml \ | ||
-e REGISTRY_USERNAME=$GITHUB_ACTOR \ | ||
-e REGISTRY_PASSWORD=$GITHUB_PAT \ | ||
-e IMAGE_NAME=docker.pkg.github.com/$GITHUB_REPOSITORY/site:latest | ||
lighthouse: | ||
needs: deploy_image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Audit live URL | ||
uses: jakejarvis/lighthouse-action@master | ||
with: | ||
url: 'https://myrt.co/en/' | ||
- name: Upload results as an artifact | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: lighthouse-report | ||
path: './report' | ||
|
||
sitespeed: | ||
needs: deploy_image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Audit live URL | ||
env: | ||
URL: https://myrt.co/en/ | ||
run: | | ||
mkdir gitlab-exporter | ||
wget -O ./gitlab-exporter/index.js https://gitlab.com/gitlab-org/gl-performance/raw/master/index.js | ||
mkdir sitespeed-results | ||
docker run --shm-size=1g --rm -v "$(pwd)":/sitespeed.io sitespeedio/sitespeed.io:6.3.1 --plugins.add ./gitlab-exporter --outputFolder sitespeed-results $URL | ||
- name: Upload results as an artifact | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: sitespeed-report | ||
path: './sitespeed-results' | ||
|
||
publish: | ||
needs: [lighthouse, sitespeed] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download lighthouse report | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: lighthouse-report | ||
- name: Download sitespeed report | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: sitespeed-report | ||
- name: Prepare deploy | ||
run: | | ||
mkdir public | ||
mv sitespeed-report public/sitespeed | ||
mkdir public/lighthouse | ||
mv lighthouse-report/https___myrt_co_en_.report.html public/lighthouse/index.html | ||
mv lighthouse-report/https___myrt_co_en_.report.json public/lighthouse/report.json | ||
- name: Deploy | ||
uses: crazy-max/ghaction-github-pages@master | ||
with: | ||
target_branch: gh-pages | ||
build_dir: public | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_PAT }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Quality assurance | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Build static files | ||
run: npm run build | ||
- name: Upload results | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: dist | ||
path: dist/ | ||
|
||
codestyle-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Codestyle check | ||
run: npm run lint | ||
|
||
spell-check: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Download build results | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: dist | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Spell check | ||
run: npm run spell-check | ||
|
||
size-check: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Download build results | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: dist | ||
- uses: actions/checkout@v1 | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Size check | ||
run: npm run size-check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.