-
Notifications
You must be signed in to change notification settings - Fork 3
45 lines (45 loc) · 1.6 KB
/
cd.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
42
43
44
45
name: Continuous Delivery
on:
push:
tags:
- '*'
jobs:
docker:
name: Build Docker Image
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup .NET Core 2.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.1.803
- name: Build
run: dotnet publish -o "$GITHUB_WORKSPACE/release" -r linux-musl-x64 -c Release src/Ztm.WebApi
- name: Login Docker
run: docker login -u ${{ github.repository }} -p ${{ secrets.GITHUB_TOKEN }} docker.pkg.github.com
- name: Build Image
run: docker build -t docker.pkg.github.com/zcoinofficial/ztm/ztm:${GITHUB_REF##*/} -f src/Ztm.WebApi/Dockerfile release
- name: Publish Image
run: docker push docker.pkg.github.com/zcoinofficial/ztm/ztm:${GITHUB_REF##*/}
ef-migration:
name: Build EF Migration Scripts
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup .NET Core 2.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.1.803
- name: Install EF CLI
run: dotnet tool install --global dotnet-ef --version 2.1.14
- name: Create PostgreSQL Script for Main Database
env:
ZTM_MAIN_DATABASE: Host=127.0.0.1;Database=postgres;Username=postgres
run: dotnet ef migrations script -o "$GITHUB_WORKSPACE/migrations/main-postgres.sql" -i -c Ztm.Data.Entity.Postgres.MainDatabase -p src/Ztm.Data.Entity.Postgres -s src/Ztm.Data.Entity.Postgres
- name: Archive Migrations
uses: actions/upload-artifact@v1
with:
name: migrations
path: migrations