-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (50 loc) · 1.43 KB
/
deco-deploy.yaml
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
name: Deploy
concurrency:
group: environment-${{ github.head_ref || github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
set_vars:
runs-on: ubuntu-latest
outputs:
site_matrix: ${{ steps.set_vars.outputs.site_matrix }}
steps:
- name: Set site matrix
id: set_vars
shell: bash
run: |
if [ -z ${{ vars.SITES }} ]; then
echo "site_matrix={site: [\"${{ github.event.repository.name }}\"] }" >> $GITHUB_OUTPUT
else
echo "site_matrix={site: ${{ vars.SITES }} }" >> $GITHUB_OUTPUT
fi
deploy:
needs: set_vars
strategy:
matrix: ${{ fromJson(needs.set_vars.outputs.site_matrix) }}
name: Deploy
runs-on: ubuntu-latest
timeout-minutes: 15 # Set your desired timeout for this job
permissions:
id-token: write # Needed for auth with Deno Deploy
contents: read # Needed to clone the repository
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Deco Deploy
id: decoDeployStep
continue-on-error: true
uses: deco-cx/deploy@v0
with:
site: ${{ matrix.site }}
- name: Retry Deco Deploy
id: decoDeployRetryStep
if: steps.decoDeployStep.outcome == 'failure'
uses: deco-cx/deploy@v0
with:
site: ${{ matrix.site }}