-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (73 loc) · 2.68 KB
/
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Deploy Dev
on:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
environment: test
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Cache Bazel
uses: actions/cache@v4
with:
path: |
~/.cache/bazel
key: ${{ runner.os }}-bazel-${{ hashFiles('.bazelversion', '.bazelrc', 'WORKSPACE') }}
restore-keys: |
${{ runner.os }}-bazel-
- uses: actions/checkout@v4
with:
lfs: true
- name: Azure CLI login
uses: azure/login@v1
with:
client-id: ${{ secrets.TEST_AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.TEST_AZURE_TENANT_ID }}
subscription-id: ${{ secrets.TEST_AZURE_SUBSCRIPTION_ID }}
allow-no-subscriptions: false
- name: Login to ACR via OIDC
run: az acr login --name rmisa
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache-dependency-path: 'frontend/package-lock.json'
# We build the frontend first just because it's faster, so if it fails, we spent
# less time to fail. We don't deploy anything until all builds + tests pass.
- name: Build the frontend
working-directory: frontend
run: |
npm ci
npm run build:test
npm run lint
npm run typecheck
- name: Run all builds and tests
run: |
bazelisk query 'tests(//... except kind(oci_*, //...))' | xargs bazelisk test
- name: Push docker images
run: |
bazelisk run --@io_bazel_rules_go//go/config:pure //cmd/server:push_image -- --tag=test
bazelisk run --@io_bazel_rules_go//go/config:pure //cmd/runner:push_image -- --tag=test
bazelisk run --@io_bazel_rules_go//go/config:pure //cmd/parser:push_image -- --tag=test
- name: Deploy backend on Container Apps
uses: azure/container-apps-deploy-action@v1
with:
disableTelemetry: true
containerAppName: pactasrv-test
containerAppEnvironment: pacta-test
resourceGroup: RMI-SP-PACTA-WEU-PAT-DEV
imageToDeploy: rmisppactaweupatdev.azurecr.io/pacta:test
location: westeurope
- name: Deploy frontend
uses: Azure/static-web-apps-deploy@v1
with:
action: 'upload'
config_file_location: 'frontend/'
app_location: 'frontend/.output/public'
api_location: 'frontend/.output/server'
output_location: ''
skip_app_build: true
skip_api_build: true
azure_static_web_apps_api_token: ${{ secrets.TEST_AZURE_STATIC_WEB_APPS_API_TOKEN }}