291st/.github/workflows/Continues Integration.yaml

101 lines
2.3 KiB
YAML
Raw Normal View History

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
container: git.zakscode.com/ztimson/runner
2023-07-26 21:11:30 -04:00
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Restore node_modules
uses: actions/cache/restore@v3
2023-07-26 23:32:41 -04:00
with:
path: node_modules
key: ${{runner.os}}-node_modules-2
- name: Install dependencies
run: npm install
- name: Cache node_modules
uses: actions/cache/save@v3
2023-07-26 21:47:07 -04:00
with:
path: ./node_modules
key: ${{runner.os}}-node_modules-2
build-dev:
name: Build
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:
path: node_modules
key: ${{runner.os}}-node_modules-2
- name: Build sources
run: npm run build:dev
- name: Cache build artifacts
uses: actions/cache@v3
with:
path: ./dist
key: dist-dev
restore-keys: dist-dev
build-prod:
name: Build production
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:
path: node_modules
key: ${{runner.os}}-node_modules
- name: Build sources
run: npm run build:prod
- name: Cache build artifacts
uses: actions/cache@v3
with:
path: ./dist
key: dist-prod
restore-keys: dist-prod
docker:
name: Build docker image
needs: build-prod
container: git.zakscode.com/ztimson/runner
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Restore build artifacts
uses: actions/cache/restore@v3
with:
path: dist
key: dist-prod
restore-keys: dist-prod
- name: Build docker image
uses: ztimson/actions/docker/build@develop
- name: Push docker image
uses: ztimson/actions/docker/push@develop
with:
registry_pass: ${{secrets.DEPLOY_TOKEN}}