This repository has been archived by the owner on Apr 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
128 lines (126 loc) · 3.67 KB
/
publish.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Publish
on:
push:
tags:
- '*'
jobs:
push_backend_to_registry:
name: Publish Backend to GitHub Packages
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/aposphere/cltp-backend-proxy
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push to GitHub Packages
uses: docker/build-push-action@v2
with:
context: backend
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
push_frontend_to_registry:
name: Publish Frontend to GitHub Packages
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/aposphere/cltp-frontend
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push to GitHub Packages
uses: docker/build-push-action@v2
with:
context: frontend
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Use Node.js
uses: actions/[email protected]
- name: Install angular cli
run: npm i -g @angular/cli
env:
CI: true
- name: Setup angular builder
run: |
cd frontend
npm ci
env:
CI: true
- name: Get version
id: version
run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//}
- name: Release
uses: actions/create-release@v1
id: create_release
with:
draft: false
# Create a prerelease if "-" is contained in the version
prerelease: ${{ contains(steps.version.outputs.version, '-') }}
release_name: Release ${{ steps.version.outputs.version }}
tag_name: ${{ github.ref }}
body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Install and Build
run: |
cd php
bash build.sh
env:
CI: true
- name: Attach PHP Build Files
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: php/cltp.zip
asset_name: cltp-${{ steps.version.outputs.version }}.zip
asset_content_type: application/zip
- name: Install and Build "SARSCov2"
run: |
cd php
bash build-SARSCov2.sh
env:
CI: true
- name: Attach PHP Build Files "SARSCov2"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: php/cltp-SARSCov2.zip
asset_name: cltp-SARSCov2-${{ steps.version.outputs.version }}.zip
asset_content_type: application/zip