88 lines
2.0 KiB
YAML
88 lines
2.0 KiB
YAML
name: Continues Integration
|
|
on: [push, workflow_dispatch]
|
|
|
|
jobs:
|
|
dependencies:
|
|
name: Install dependencies
|
|
container:
|
|
image: node:latest
|
|
volumes:
|
|
- /mnt/swarm/gitea/runner/cache:/cache
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
uses: ztimson/actions/git/checkout@develop
|
|
|
|
- name: Install dependencies
|
|
run: npm install
|
|
|
|
- uses: ztimson/actions/tar/compress@develop
|
|
with:
|
|
pattern: node_modules/*
|
|
- run: ls
|
|
- run: mv archive.tar.gz /cache/
|
|
|
|
build-dev:
|
|
name: Build
|
|
needs: dependencies
|
|
container: git.zakscode.com/ztimson/runner
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
uses: ztimson/actions/git/checkout@develop
|
|
|
|
- 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:dev
|
|
|
|
- name: Cache build artifacts
|
|
uses: actions/cache/save@v3
|
|
with:
|
|
path: ./dist
|
|
key: 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/save@v3
|
|
with:
|
|
path: ./dist
|
|
key: dist-prod
|
|
|
|
docker:
|
|
name: Build docker image
|
|
container: docker
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
uses: ztimson/actions/git/checkout@develop
|
|
|
|
- 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}}
|