1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2024-09-19 22:15:53 +02:00
.profile/.github/workflows/Divlo.yml

186 lines
4.2 KiB
YAML
Raw Normal View History

2021-04-18 22:30:27 +02:00
name: 'Divlo'
2021-04-18 01:56:23 +02:00
on:
push:
2021-06-13 01:53:13 +02:00
branches: [master, develop]
2021-04-18 01:56:23 +02:00
pull_request:
2021-06-13 01:53:13 +02:00
branches: [master, develop]
2021-04-18 01:56:23 +02:00
jobs:
2021-05-31 15:04:17 +02:00
analyze:
2021-04-18 01:56:23 +02:00
runs-on: 'ubuntu-latest'
2021-05-31 15:04:17 +02:00
2021-04-18 01:56:23 +02:00
strategy:
2021-05-31 15:04:17 +02:00
fail-fast: false
2021-04-18 01:56:23 +02:00
matrix:
2021-05-31 15:04:17 +02:00
language: ['javascript']
steps:
2021-10-01 08:51:07 +02:00
- uses: 'actions/checkout@v2.4.0'
2021-05-31 15:04:17 +02:00
- name: 'Initialize CodeQL'
uses: 'github/codeql-action/init@v1'
with:
languages: ${{ matrix.language }}
- name: 'Perform CodeQL Analysis'
uses: 'github/codeql-action/analyze@v1'
2021-09-10 20:39:41 +02:00
build:
runs-on: 'ubuntu-latest'
steps:
2021-10-01 08:51:07 +02:00
- uses: 'actions/checkout@v2.4.0'
2021-09-10 20:39:41 +02:00
- name: 'Use Node.js'
2021-12-04 15:52:51 +01:00
uses: 'actions/setup-node@v2.5.1'
2021-09-10 20:39:41 +02:00
with:
node-version: '16.x'
cache: 'npm'
- name: 'Install'
run: 'npm install'
- name: 'Build'
run: 'npm run build'
2021-05-31 15:04:17 +02:00
lint:
runs-on: 'ubuntu-latest'
2021-04-18 01:56:23 +02:00
steps:
2021-10-01 08:51:07 +02:00
- uses: 'actions/checkout@v2.4.0'
2021-04-18 01:56:23 +02:00
2021-05-31 15:04:17 +02:00
- name: 'Use Node.js'
2021-12-04 15:52:51 +01:00
uses: 'actions/setup-node@v2.5.1'
2021-04-18 01:56:23 +02:00
with:
2021-06-13 01:53:13 +02:00
node-version: '16.x'
cache: 'npm'
2021-04-18 01:56:23 +02:00
2021-05-31 15:04:17 +02:00
- name: 'Install'
run: 'npm install'
2021-05-31 15:04:17 +02:00
2021-12-04 15:52:51 +01:00
- name: 'lint:commit'
run: 'npm run lint:commit -- --to "${{ github.sha }}"'
2021-05-31 15:04:17 +02:00
2021-12-04 15:52:51 +01:00
- name: 'lint:editorconfig'
run: 'npm run lint:editorconfig'
- name: 'lint:markdown'
run: 'npm run lint:markdown'
- name: 'lint:typescript'
run: 'npm run lint:typescript'
- name: 'lint:prettier'
run: 'npm run lint:prettier'
- name: 'lint:dotenv'
2021-10-01 08:51:07 +02:00
uses: 'dotenv-linter/action-dotenv-linter@v2'
with:
github_token: ${{ secrets.github_token }}
2021-12-04 15:52:51 +01:00
- name: 'lint:docker'
uses: 'hadolint/hadolint-action@v1.6.0'
with:
dockerfile: './Dockerfile'
2021-08-13 15:48:29 +02:00
test-unit:
runs-on: 'ubuntu-latest'
steps:
2021-10-01 08:51:07 +02:00
- uses: 'actions/checkout@v2.4.0'
2021-08-13 15:48:29 +02:00
- name: 'Use Node.js'
2021-12-04 15:52:51 +01:00
uses: 'actions/setup-node@v2.5.1'
2021-08-13 15:48:29 +02:00
with:
node-version: '16.x'
cache: 'npm'
- name: 'Install'
run: 'npm install'
- name: 'Unit Test'
run: 'npm run test:unit'
test-lighthouse:
2021-05-31 15:04:17 +02:00
runs-on: 'ubuntu-latest'
steps:
2021-10-01 08:51:07 +02:00
- uses: 'actions/checkout@v2.4.0'
2021-05-31 15:04:17 +02:00
- name: 'Use Node.js'
2021-12-04 15:52:51 +01:00
uses: 'actions/setup-node@v2.5.1'
2021-05-31 15:04:17 +02:00
with:
2021-06-13 01:53:13 +02:00
node-version: '16.x'
cache: 'npm'
2021-05-31 15:04:17 +02:00
- name: 'Install'
run: 'npm install'
2021-05-31 15:04:17 +02:00
- name: 'Build'
run: 'npm run build'
2021-12-04 15:52:51 +01:00
- name: 'html-w3c-validator'
run: 'npm run test:html-w3c-validator'
2021-05-31 15:04:17 +02:00
- name: 'Lighthouse'
2021-08-13 15:48:29 +02:00
run: 'npm run test:lighthouse'
2021-06-15 20:35:52 +02:00
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
2021-05-31 15:04:17 +02:00
2021-08-13 15:48:29 +02:00
test-e2e:
2021-05-31 15:04:17 +02:00
runs-on: 'ubuntu-latest'
steps:
2021-10-01 08:51:07 +02:00
- uses: 'actions/checkout@v2.4.0'
2021-05-31 15:04:17 +02:00
- name: 'Use Node.js'
2021-12-04 15:52:51 +01:00
uses: 'actions/setup-node@v2.5.1'
2021-05-31 15:04:17 +02:00
with:
2021-06-13 01:53:13 +02:00
node-version: '16.x'
cache: 'npm'
2021-05-31 15:04:17 +02:00
- name: 'Install'
run: 'npm install'
2021-05-31 15:04:17 +02:00
2021-08-13 15:48:29 +02:00
- name: 'Build'
run: 'npm run build'
- name: 'End To End (e2e) Test'
run: 'npm run test:e2e'
2021-05-31 15:04:17 +02:00
release:
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
2021-09-10 20:39:41 +02:00
needs: [analyze, build, lint, test-unit, test-lighthouse, test-e2e]
2021-05-31 15:04:17 +02:00
runs-on: 'ubuntu-latest'
steps:
2021-10-01 08:51:07 +02:00
- uses: 'actions/checkout@v2.4.0'
with:
fetch-depth: 0
persist-credentials: false
2021-05-31 15:04:17 +02:00
- name: 'Import GPG key'
uses: 'crazy-max/ghaction-import-gpg@v4'
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
git_user_signingkey: true
git_commit_gpgsign: true
2021-05-31 15:04:17 +02:00
- name: 'Use Node.js'
2021-12-04 15:52:51 +01:00
uses: 'actions/setup-node@v2.5.1'
2021-05-31 15:04:17 +02:00
with:
2021-06-13 01:53:13 +02:00
node-version: '16.x'
cache: 'npm'
2021-05-31 15:04:17 +02:00
- name: 'Install'
run: 'npm install'
2021-05-31 15:04:17 +02:00
- name: 'Release'
run: 'npm run release'
env:
2021-07-27 20:01:21 +02:00
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GIT_COMMITTER_NAME: ${{ secrets.GIT_NAME }}
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_EMAIL }}
2021-07-27 19:00:21 +02:00
- name: 'Deploy to Vercel'
run: 'npm run deploy -- --token="${VERCEL_TOKEN}" --prod'
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}