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
|
|
|
|
2023-08-06 22:25:36 -04:00
|
|
|
- name: Restore cache
|
|
|
|
uses: ztimson/actions/cache/restore@develop
|
2023-08-06 22:50:07 -04:00
|
|
|
with:
|
|
|
|
key: node_modules
|
2023-08-06 22:25:36 -04:00
|
|
|
|
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 22:25:36 -04:00
|
|
|
- name: Cache node_modules
|
2023-08-06 22:52:17 -04:00
|
|
|
uses: ztimson/actions/cache@develop
|
2023-08-06 21:58:59 -04:00
|
|
|
with:
|
2023-08-06 22:50:07 -04:00
|
|
|
key: node_modules
|
2023-08-06 22:18:51 -04:00
|
|
|
pattern: 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
|
2023-08-06 21:34:40 -04:00
|
|
|
uses: ztimson/actions/git/checkout@develop
|
2023-07-28 13:16:51 -04:00
|
|
|
|
2023-08-06 22:50:07 -04:00
|
|
|
- name: Restore cache
|
|
|
|
uses: ztimson/actions/cache/restore@develop
|
2023-07-28 13:16:51 -04:00
|
|
|
with:
|
2023-08-06 22:50:07 -04:00
|
|
|
key: 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 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
|
2023-08-06 22:50:07 -04:00
|
|
|
uses: ztimson/actions/git/checkout@develop
|
2023-07-28 13:37:19 -04:00
|
|
|
|
2023-08-06 22:50:07 -04:00
|
|
|
- name: Restore cache
|
|
|
|
uses: ztimson/actions/cache/restore@develop
|
2023-07-28 13:37:19 -04:00
|
|
|
with:
|
2023-08-06 22:50:07 -04:00
|
|
|
key: node_modules
|
2023-07-28 13:37:19 -04:00
|
|
|
|
|
|
|
- name: Build sources
|
|
|
|
run: npm run build:prod
|
|
|
|
|
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}}
|