|
1 | 1 | name: Build, deploy & check Mirror
|
| 2 | +env: |
| 3 | + PREVIEW_REPO: 'https://preview-mirror.mage-os.org/' |
| 4 | + PROD_REPO: 'https://mirror.mage-os.org/' |
| 5 | + PREVIEW_REMOTE_DIR: '/var/www/preview-mirror.mage-os.org/html/' |
| 6 | + PROD_REMOTE_DIR: '/var/www/mirror.mage-os.org/html/' |
2 | 7 |
|
3 | 8 | on:
|
4 | 9 | workflow_dispatch:
|
5 | 10 | inputs:
|
6 | 11 | repo:
|
7 | 12 | description: 'The composer repository url'
|
8 | 13 | required: true
|
9 |
| - default: 'https://preview-mirror.mage-os.org/' |
| 14 | + default: ${{ env.PREVIEW_REPO }} |
10 | 15 | type: choice
|
11 | 16 | options:
|
12 |
| - - https://preview-mirror.mage-os.org/ |
13 |
| - - https://mirror.mage-os.org/ |
| 17 | + - ${{ env.PREVIEW_REPO }} |
| 18 | + - ${{ env.PROD_REPO }} |
14 | 19 | remote_dir:
|
15 | 20 | description: 'The deploy target directory on the repo host'
|
16 | 21 | required: true
|
17 |
| - default: '/var/www/preview-mirror.mage-os.org/html/' |
| 22 | + default: ${{ env.PREVIEW_REMOTE_DIR }} |
18 | 23 | type: choice
|
19 | 24 | options:
|
20 |
| - - /var/www/preview-mirror.mage-os.org/html/ |
21 |
| - - /var/www/mirror.mage-os.org/html/ |
| 25 | + - ${{ env.PREVIEW_REMOTE_DIR }} |
| 26 | + - ${{ env.PROD_REMOTE_DIR }} |
22 | 27 | push:
|
23 | 28 | branches:
|
24 |
| - - main |
| 29 | + - main |
25 | 30 |
|
26 | 31 | jobs:
|
27 | 32 | deploy:
|
28 | 33 | uses: ./.github/workflows/deploy.yml
|
29 | 34 | name: "generate & deploy"
|
30 | 35 | if: contains('["vinai", "rhoerr", "fballiano", "mage-os-ci"]', github.actor)
|
31 | 36 | with:
|
32 |
| - repo: ${{ inputs.repo }} |
33 |
| - remote_dir: ${{ inputs.remote_dir }} |
| 37 | + repo: ${{ (github.event_name == 'workflow_dispatch' && inputs.repo) || env.PREVIEW_REPO }} |
| 38 | + remote_dir: ${{ (github.event_name == 'workflow_dispatch' && inputs.remote_dir) || env.PREVIEW_REMOTE_DIR }} |
34 | 39 | entrypoint: src/make/mirror.js
|
35 | 40 | delete: true
|
36 | 41 | secrets:
|
37 | 42 | SERVER_SSH_KEY: ${{ secrets.SERVER_SSH_KEY }}
|
38 | 43 | REMOTE_USER: ${{ secrets.REMOTE_USER }}
|
| 44 | + |
39 | 45 | integrity-check:
|
40 | 46 | needs: [deploy]
|
41 | 47 | uses: ./.github/workflows/integrity-check.yml
|
42 | 48 | with:
|
43 |
| - repo: ${{ inputs.repo }} |
| 49 | + repo: ${{ (github.event_name == 'workflow_dispatch' && inputs.repo) || env.PREVIEW_REPO }} |
44 | 50 | secrets:
|
45 | 51 | COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
|
0 commit comments