Skip to content

Commit

Permalink
Merge pull request #4 from mishamyrt/develop
Browse files Browse the repository at this point in the history
Release 1.4.0
  • Loading branch information
mishamyrt authored Oct 2, 2019
2 parents 9f96d43 + 13910d7 commit 612becb
Show file tree
Hide file tree
Showing 33 changed files with 3,791 additions and 1,111 deletions.
8 changes: 8 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/Feature.md
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.

41 changes: 41 additions & 0 deletions .github/workflows/build-dev.yml
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
43 changes: 43 additions & 0 deletions .github/workflows/build-tag.yml
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
127 changes: 127 additions & 0 deletions .github/workflows/deploy.yml
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 }}
58 changes: 58 additions & 0 deletions .github/workflows/qa.yml
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
2 changes: 1 addition & 1 deletion .gitlab/ci/dockerize.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
before_script:
- echo -n $CI_JOB_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY
script:
- docker build -t $CI_REGISTRY_IMAGE:$BUILD_VERSION -f docker/Dockerfile .
- docker build -t $CI_REGISTRY_IMAGE:$BUILD_VERSION -f docker/Dockerfile ./dist
- docker push $CI_REGISTRY_IMAGE

build docker image:
Expand Down
30 changes: 25 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog][],
and this project adheres to [Semantic Versioning][].

## [1.4.0][] — 2019-10-02

### Added

- GitHub Actions.
- Skills block to resume.
- Link to Keybase.
- Class mangling.

### Changed

- Moving to GitHub from GitLab.
- Carried the styles inside the HTML.

### Fixed

- Icons hover on dark mode.

## [1.3.1][] — 2019-09-28

### Added
Expand Down Expand Up @@ -71,12 +89,14 @@ and this project adheres to [Semantic Versioning][].

[semantic versioning]: https://semver.org/spec/v2.0.0.html

[1.0.0]: https://gitlab.com/mishamyrt/myrt.co/tree/v1.0.0
[1.0.0]: https://github.com/mishamyrt/myrt.co/releases/tag/v1.0.0

[1.1.0]: https://github.com/mishamyrt/myrt.co/releases/tag/v1.1.0

[1.1.0]: https://gitlab.com/mishamyrt/myrt.co/tree/v1.1.0
[1.2.0]: https://github.com/mishamyrt/myrt.co/releases/tag/v1.2.0

[1.2.0]: https://gitlab.com/mishamyrt/myrt.co/tree/v1.2.0
[1.3.0]: https://github.com/mishamyrt/myrt.co/releases/tag/v1.3.0

[1.3.0]: https://gitlab.com/mishamyrt/myrt.co/tree/v1.3.0
[1.3.1]: https://github.com/mishamyrt/myrt.co/releases/tag/v1.3.1

[1.3.1]: https://gitlab.com/mishamyrt/myrt.co/tree/v1.3.1
[1.4.0]: https://github.com/mishamyrt/myrt.co/releases/tag/v1.4.0
25 changes: 20 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
# Mikhael Khrustik's homepage

This project is made as an example of the capabilities of GitLab CI and in order to teach best DevOps practices.
<h1 align="center">
Misha's homepage
</h1>

<p align="center">
<a href="https://github.com/mishamyrt/myrt.co/actions?workflow=Quality+assurance">
<img src="https://github.com/mishamyrt/myrt.co/workflows/Quality%20assurance/badge.svg">
</a>
<a href="https://mishamyrt.github.io/myrt.co/lighthouse/">
<img src="https://lighthouse-badge.appspot.com/?score=100">
</a>
<a href="https://mishamyrt.github.io/myrt.co/sitespeed/">
<img src="https://img.shields.io/badge/dynamic/json?color=0095d2&url=https://mishamyrt.github.io/myrt.co/sitespeed/data/performance.json&label=Sitespeed.io%20score&query=$[0].metrics[2].value&style=flat-square">
</a>
</p>

This project is made as an example of the capabilities of GitHub Actions and in order to teach best DevOps practices.

## Getting Started

Expand All @@ -25,7 +39,7 @@ You can start serving local site by running `npm run start`.

Deploy occurs automatically when the code gets into the master branch.

Deploy logic is implemented on ansible playbook.
Deploy logic is implemented with ansible playbook.

## Built With

Expand All @@ -35,7 +49,7 @@ Deploy logic is implemented on ansible playbook.

## Versioning

I use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://gitlab.com/mishamyrt/myrt.co/-/tags).
I use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/mishamyrt/myrt.co/tags).

## Authors

Expand All @@ -44,3 +58,4 @@ I use [SemVer](http://semver.org/) for versioning. For the versions available, s
## License

This project is licensed under the WTFPL License - see the [LICENSE](LICENSE) file for details

Loading

0 comments on commit 612becb

Please sign in to comment.