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-08-06 21:41:34 -04:00
|
|
|
container:
|
|
|
|
image: node:latest
|
|
|
|
volumes:
|
|
|
|
- /mnt/swarm/gitea/runner/cache:/cache
|
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
|
2023-08-06 21:27:40 -04:00
|
|
|
uses: ztimson/actions/git/checkout@develop
|
2023-07-28 13:16:51 -04:00
|
|
|
|
|
|
|
- name: Install dependencies
|
2023-07-28 13:42:20 -04:00
|
|
|
run: npm install
|
2023-08-06 21:41:34 -04:00
|
|
|
|
2023-08-06 21:58:59 -04:00
|
|
|
- uses: ztimson/actions/tar/compress@develop
|
|
|
|
with:
|
|
|
|
pattern: node_modules/*
|
|
|
|
- run: mv archive.tar.gz /cache/
|
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
|
2023-08-06 21:34:40 -04:00
|
|
|
uses: ztimson/actions/git/checkout@develop
|
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-08-06 21:34:40 -04:00
|
|
|
container: docker
|
2023-07-28 10:45:27 -04:00
|
|
|
steps:
|
|
|
|
|
2023-07-28 14:01:08 -04:00
|
|
|
- name: Checkout repository
|
2023-08-06 21:34:40 -04:00
|
|
|
uses: ztimson/actions/git/checkout@develop
|
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}}
|