-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (58 loc) · 1.88 KB
/
frontend-deploy.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
name: ScafiWeb frontend deploy
on: [push, workflow_dispatch]
jobs:
Build:
strategy:
# Using matrix build even if not needed
matrix:
os: [ ubuntu-20.04 ]
jvm_version: [ 11 ]
runs-on: ${{ matrix.os }}
steps:
# Checkout the repository
- name: Checkout
uses: actions/[email protected]
- name: Setup Scala with Java ${{ matrix.jvm_version }}
uses: olafurpg/setup-scala@v11
with:
java-version: adopt@1.${{ matrix.java }}
- name: Coursier cache
uses: coursier/cache-action@v5
- name: Sbt test
run: sbt test
Deploy:
runs-on: ubuntu-latest
needs: [Build]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
# Checkout the repository
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
submodules: recursive
- name: Fetch tags
run: git fetch --tags -f
- name: Setup Scala
uses: olafurpg/setup-scala@v11
- name: Coursier cache
uses: coursier/cache-action@v5
- name: Build project scafi-web project with SBT
run: sbt -v "project frontend; fullOptJS::webpack"
- name: Build compiler
run: sbt "project online-compiler; assembly"
- name: Adjust folders for deployment
run: .github/scripts/adjust-deployment.sh
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
external_repository: scafi/web
publish_dir: ./public
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Upload compiler service to Docker Hub
run: .github/scripts/docker-release.sh