2023-07-28 10:36:55 -04:00
|
|
|
name: Continues Integration
|
2023-07-28 10:01:28 -04:00
|
|
|
on: [push, workflow_dispatch]
|
2023-07-26 21:11:30 -04:00
|
|
|
|
|
|
|
jobs:
|
2023-07-28 10:28:58 -04:00
|
|
|
dependencies:
|
|
|
|
name: Install dependencies
|
2023-07-28 13:16:51 -04:00
|
|
|
container: git.zakscode.com/ztimson/runner
|
2023-07-26 21:11:30 -04:00
|
|
|
steps:
|
2023-07-28 13:16:51 -04:00
|
|
|
|
2023-07-28 13:37:19 -04:00
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v3
|
2023-07-28 13:16:51 -04:00
|
|
|
|
|
|
|
- name: Restore node_modules
|
2023-07-28 17:41:52 -04:00
|
|
|
uses: actions/cache/restore@v3
|
2023-07-26 23:32:41 -04:00
|
|
|
with:
|
2023-07-28 14:53:25 -04:00
|
|
|
path: node_modules
|
2023-07-28 18:07:14 -04:00
|
|
|
key: ${{runner.os}}-node_modules
|
2023-07-28 13:16:51 -04:00
|
|
|
|
|
|
|
- name: Install dependencies
|
2023-07-28 13:42:20 -04:00
|
|
|
run: npm install
|
2023-07-28 13:16:51 -04:00
|
|
|
|
|
|
|
- name: Cache node_modules
|
2023-07-28 17:58:48 -04:00
|
|
|
uses: actions/cache/save@v3
|
2023-07-26 21:47:07 -04:00
|
|
|
with:
|
2023-07-28 17:41:52 -04:00
|
|
|
path: ./node_modules
|
2023-07-28 18:07:14 -04:00
|
|
|
key: ${{runner.os}}-node_modules
|
2023-07-28 13:16:51 -04:00
|
|
|
|
2023-07-28 13:37:19 -04:00
|
|
|
build-dev:
|
2023-07-28 13:42:20 -04:00
|
|
|
name: Build
|
2023-07-28 13:16:51 -04:00
|
|
|
needs: dependencies
|
|
|
|
container: git.zakscode.com/ztimson/runner
|
|
|
|
steps:
|
|
|
|
|
2023-07-28 13:37:19 -04:00
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v3
|
2023-07-28 13:16:51 -04:00
|
|
|
|
|
|
|
- name: Restore node_modules
|
2023-07-28 17:50:17 -04:00
|
|
|
uses: actions/cache/restore@v3
|
2023-07-28 13:16:51 -04:00
|
|
|
with:
|
2023-07-28 17:39:26 -04:00
|
|
|
path: node_modules
|
2023-07-28 18:07:14 -04:00
|
|
|
key: ${{runner.os}}-node_modules
|
2023-07-28 13:16:51 -04:00
|
|
|
|
|
|
|
- name: Build sources
|
2023-07-28 13:37:19 -04:00
|
|
|
run: npm run build:dev
|
2023-07-28 13:16:51 -04:00
|
|
|
|
2023-07-28 14:44:11 -04:00
|
|
|
- name: Cache build artifacts
|
2023-07-28 18:07:14 -04:00
|
|
|
uses: actions/cache/save@v3
|
2023-07-28 13:16:51 -04:00
|
|
|
with:
|
2023-07-28 14:44:11 -04:00
|
|
|
path: ./dist
|
|
|
|
key: dist-dev
|
2023-07-28 13:16:51 -04:00
|
|
|
|
2023-07-28 13:37:19 -04:00
|
|
|
build-prod:
|
2023-07-28 13:42:20 -04:00
|
|
|
name: Build production
|
2023-07-28 13:37:19 -04:00
|
|
|
needs: dependencies
|
|
|
|
container: git.zakscode.com/ztimson/runner
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Restore node_modules
|
|
|
|
uses: actions/cache/restore@v3
|
|
|
|
with:
|
2023-07-28 17:50:17 -04:00
|
|
|
path: node_modules
|
2023-07-28 17:20:12 -04:00
|
|
|
key: ${{runner.os}}-node_modules
|
2023-07-28 13:37:19 -04:00
|
|
|
|
|
|
|
- name: Build sources
|
|
|
|
run: npm run build:prod
|
|
|
|
|
2023-07-28 14:44:11 -04:00
|
|
|
- name: Cache build artifacts
|
2023-07-28 18:07:14 -04:00
|
|
|
uses: actions/cache/save@v3
|
2023-07-28 13:37:19 -04:00
|
|
|
with:
|
2023-07-28 14:44:11 -04:00
|
|
|
path: ./dist
|
|
|
|
key: dist-prod
|
2023-07-28 13:37:19 -04:00
|
|
|
|
2023-07-28 13:16:51 -04:00
|
|
|
docker:
|
2023-07-28 13:42:20 -04:00
|
|
|
name: Build docker image
|
2023-07-28 14:10:06 -04:00
|
|
|
needs: build-prod
|
2023-07-28 13:16:51 -04:00
|
|
|
container: git.zakscode.com/ztimson/runner
|
2023-07-28 10:45:27 -04:00
|
|
|
steps:
|
|
|
|
|
2023-07-28 14:01:08 -04:00
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2023-07-28 14:44:11 -04:00
|
|
|
- name: Restore build artifacts
|
|
|
|
uses: actions/cache/restore@v3
|
2023-07-28 14:10:06 -04:00
|
|
|
with:
|
2023-07-28 14:53:25 -04:00
|
|
|
path: dist
|
2023-07-28 14:44:11 -04:00
|
|
|
key: dist-prod
|
2023-07-28 14:57:24 -04:00
|
|
|
restore-keys: dist-prod
|
2023-07-28 14:21:57 -04:00
|
|
|
|
2023-07-28 14:01:08 -04:00
|
|
|
- name: Build docker image
|
|
|
|
uses: ztimson/actions/docker/build@develop
|
2023-07-28 13:16:51 -04:00
|
|
|
|
2023-07-28 14:01:08 -04:00
|
|
|
- name: Push docker image
|
|
|
|
uses: ztimson/actions/docker/push@develop
|
2023-07-28 10:45:27 -04:00
|
|
|
with:
|
2023-07-28 14:01:08 -04:00
|
|
|
registry_pass: ${{secrets.DEPLOY_TOKEN}}
|