-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (58 loc) · 1.65 KB
/
Copy pathhosting.yaml
File metadata and controls
66 lines (58 loc) · 1.65 KB
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
name: Hosting
on:
push:
paths:
- .github/workflows/hosting.yaml
- .hosting/**
branches:
- main
# uncomment this line to run every 4 hours
# schedule:
# - cron: '0 */4 * * *'
workflow_run:
workflows: [ CI ]
types: [ completed ]
branches: [ main ]
workflow_dispatch:
env:
HOSTING_PATH: .hosting
IMAGE_NAME: ${{ github.repository }}
REGISTRY: ghcr.io
permissions:
contents: write
jobs:
run-backend-service-app:
name: Run backend service app
if: ${{ github.event.workflow_run == null || github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: ${{ env.HOSTING_PATH }}
sparse-checkout-cone-mode: false
- name: Create .env files
working-directory: ${{ env.HOSTING_PATH }}
run: |
cat <<EOT > app.env
FRONTEND_HOST=${{ github.repository_owner }}.github.io
EOT
cat <<EOT > tunnel.env
GITHUB_REPOSITORY=${{ github.repository }}
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
EOT
- name: Nx set SHAs
id: setSHAs
uses: nrwl/nx-set-shas@v4.3.3
with:
workflow-id: ci.yaml
set-environment-variables-for-job: false
- name: Up docker compose
working-directory: ${{ env.HOSTING_PATH }}
run: |
TAG=${{ steps.setSHAs.outputs.base }} docker compose up --pull=always
- name: Logs to artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: logs
path: .hosting/logs/**