-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (38 loc) · 1.01 KB
/
deploy-job.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Deploy urlshortener by runner
on:
push:
branches: [ "main" ]
paths:
- urlshortener/**
- .github/workflows/**
defaults:
run:
working-directory: urlshortener
jobs:
test:
runs-on: self-hosted
steps:
- name: cd into repo
uses: actions/checkout@v3
- name: setup tests
run: docker compose run --build --rm app server db_setup test
- name: run tests
run: docker compose up --build test
prepare-environment:
runs-on: self-hosted
needs: test
steps:
- name: Stop and remove containers, networks
run: docker compose down
- name: Remove unused data
run: docker system prune -a -f
deploy:
runs-on: self-hosted
needs: prepare-environment
steps:
- name: checkout repo
uses: actions/checkout@v3
- name: dev setup
run: docker compose run --build --rm app server db_setup dev
- name: dev up
run: docker compose run --rm --build --service-ports app server serve dev