Skip to content

Commit d9a1f9d

Browse files
committed
m i c r o s e r v i c e s
We have two services: - Backend - App compiler This is so that the compiler can run in an isolated environment - with concurrency of 1 - without bringing down backend as well. It allows the backend to handle multiple requests per container, which will be useful in the future when the playground can do more than just compiling code
1 parent 17b21cc commit d9a1f9d

16 files changed

+719
-154
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Build & Publish App Compiler
2+
on:
3+
push:
4+
branches: [ master ]
5+
paths:
6+
- 'app/**'
7+
- 'services/app-compiler/**'
8+
- 'Cargo.*'
9+
- '.github/workflows/build-publish-app-compiler.yml'
10+
11+
jobs:
12+
app:
13+
name: Build and publish app
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up QEMU
18+
uses: docker/setup-qemu-action@v1
19+
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v1
22+
23+
- id: 'auth'
24+
name: 'Authenticate to Google Cloud'
25+
uses: 'google-github-actions/auth@v0'
26+
with:
27+
token_format: 'access_token'
28+
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'
29+
30+
- name: Login to Google Artifacts Registry
31+
uses: docker/login-action@v1
32+
with:
33+
registry: us-docker.pkg.dev/
34+
username: oauth2accesstoken
35+
password: ${{ steps.auth.outputs.access_token }}
36+
37+
- name: Build and push
38+
id: docker_build
39+
uses: docker/build-push-action@v2
40+
with:
41+
context: app
42+
push: true
43+
tags: us-docker.pkg.dev/yew-rs/yew-playground/app:latest
44+
45+
- name: Image digest
46+
run: echo ${{ steps.docker_build.outputs.digest }}
47+
48+
compiler:
49+
name: Build & publish app compiler
50+
runs-on: ubuntu-latest
51+
needs:
52+
- app
53+
steps:
54+
- uses: actions/checkout@v2
55+
56+
- name: Set up QEMU
57+
uses: docker/setup-qemu-action@v1
58+
59+
- name: Set up Docker Buildx
60+
uses: docker/setup-buildx-action@v1
61+
62+
- id: 'auth'
63+
name: 'Authenticate to Google Cloud'
64+
uses: 'google-github-actions/auth@v0'
65+
with:
66+
token_format: 'access_token'
67+
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'
68+
69+
- name: Login to Google Artifacts Registry
70+
uses: docker/login-action@v1
71+
with:
72+
registry: us-docker.pkg.dev/
73+
username: oauth2accesstoken
74+
password: ${{ steps.auth.outputs.access_token }}
75+
76+
- name: Build and push
77+
id: docker_build
78+
uses: docker/build-push-action@v2
79+
with:
80+
context: services/app-compiler
81+
push: true
82+
tags: us-docker.pkg.dev/yew-rs/yew-playground/playground-compiler:latest
83+
84+
- name: Image digest
85+
run: echo ${{ steps.docker_build.outputs.digest }}
86+
87+
- name: Deploy URL
88+
run: echo ${{ steps.deploy.outputs.url }}

.github/workflows/build-publish-backend.yml

+1-40
Original file line numberDiff line numberDiff line change
@@ -3,53 +3,14 @@ on:
33
push:
44
branches: [ master ]
55
paths:
6-
- 'app/**'
7-
- 'backend/**'
6+
- 'services/backend/**'
87
- 'Cargo.*'
98
- '.github/workflows/build-publish-backend.yml'
109

1110
jobs:
12-
app:
13-
name: Build and publish app
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: actions/checkout@v2
17-
- name: Set up QEMU
18-
uses: docker/setup-qemu-action@v1
19-
20-
- name: Set up Docker Buildx
21-
uses: docker/setup-buildx-action@v1
22-
23-
- id: 'auth'
24-
name: 'Authenticate to Google Cloud'
25-
uses: 'google-github-actions/auth@v0'
26-
with:
27-
token_format: 'access_token'
28-
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'
29-
30-
- name: Login to Google Artifacts Registry
31-
uses: docker/login-action@v1
32-
with:
33-
registry: us-docker.pkg.dev/
34-
username: oauth2accesstoken
35-
password: ${{ steps.auth.outputs.access_token }}
36-
37-
- name: Build and push
38-
id: docker_build
39-
uses: docker/build-push-action@v2
40-
with:
41-
context: app
42-
push: true
43-
tags: us-docker.pkg.dev/yew-rs/yew-playground/app:latest
44-
45-
- name: Image digest
46-
run: echo ${{ steps.docker_build.outputs.digest }}
47-
4811
backend:
4912
name: Build & publish backend
5013
runs-on: ubuntu-latest
51-
needs:
52-
- app
5314
steps:
5415
- uses: actions/checkout@v2
5516

.idea/yew-playground.iml

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)