-
Notifications
You must be signed in to change notification settings - Fork 12
134 lines (109 loc) · 4.45 KB
/
initialize-rss-reader-app.yml
File metadata and controls
134 lines (109 loc) · 4.45 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
---
name: Initialize Custom RSS Reader App
on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to initialize in (stage or production)'
required: true
default: 'stage'
type: choice
options:
- stage
- production
app_name:
description: 'App Name (used for instance title)'
required: true
type: string
default: 'BBC News'
app_description:
description: 'App Description (used in manifest description)'
required: true
type: string
default: 'Latest news from BBC World Service'
rss_title:
description: 'RSS Title (title to display in the app)'
required: true
type: string
default: 'BBC News'
icon_url:
description: 'Icon URL (publicly accessible icon image)'
required: true
type: string
default: 'https://playground.srly.io/edge-apps/rss-reader/static/img/icon.svg'
rss_url:
description: 'RSS Feed URL'
required: true
type: string
default: 'http://feeds.bbci.co.uk/news/rss.xml'
run-name: Initialize RSS Reader - ${{ inputs.app_name }} in ${{ inputs.environment }}
jobs:
deploy:
name: Initializing ${{ inputs.app_name }} in ${{ inputs.environment }}
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
environment: ${{ inputs.environment }}
env:
API_BASE_URL: ${{ inputs.environment == 'stage' && 'https://api.screenlyappstage.com' || 'https://api.screenlyapp.com' }}
APP_NAME: ${{ inputs.app_name }}
APP_PATH: edge-apps/rss-reader
SCREENLY_API_TOKEN: ${{ secrets.SCREENLY_API_TOKEN }}
MANIFEST_FILE_NAME: ${{ inputs.environment == 'stage' && 'screenly_qc.yml' || 'screenly.yml' }}
steps:
- name: ⬇️ Checkout Repository
uses: actions/checkout@v6
with:
ref: master
- name: 🛠 Setup yq
uses: ./.github/actions/setup-yq
- name: 🔧 Update manifest file with custom values
run: |
MANIFEST_FILE="${{ env.APP_PATH }}/${{ env.MANIFEST_FILE_NAME }}"
echo "📝 Updating $MANIFEST_FILE with custom configuration..."
# Remove the existing ID (will be auto-generated during create)
yq -i 'del(.id)' "$MANIFEST_FILE"
# Update description
yq -i '.description = "${{ inputs.app_description }}"' "$MANIFEST_FILE"
# Update icon URL
yq -i '.icon = "${{ inputs.icon_url }}"' "$MANIFEST_FILE"
# Update RSS URL default value
yq -i '.settings.rss_url.default_value = "${{ inputs.rss_url }}"' "$MANIFEST_FILE"
# Update RSS Title default value
yq -i '.settings.rss_title.default_value = "${{ inputs.rss_title }}"' "$MANIFEST_FILE"
echo ""
echo "✅ Updated manifest with:"
echo " Description: ${{ inputs.app_description }}"
echo " Icon URL: ${{ inputs.icon_url }}"
echo " RSS URL: ${{ inputs.rss_url }}"
echo " RSS Title: ${{ inputs.rss_title }}"
- name: 📋 Show updated manifest
run: |
echo "📄 Contents of updated manifest:"
cat ${{ env.APP_PATH }}/${{ env.MANIFEST_FILE_NAME }}
- name: 🛠 Create Edge App
uses: screenly/cli@master
with:
screenly_api_token: ${{ env.SCREENLY_API_TOKEN }}
cli_commands: edge-app create --name="${{ env.APP_NAME }}" --in-place --path="${{ env.APP_PATH }}"
- name: 🚀 Deploy Edge App
uses: screenly/cli@master
with:
screenly_api_token: ${{ env.SCREENLY_API_TOKEN }}
cli_commands: edge-app deploy --path="${{ env.APP_PATH }}"
- name: 📋 Log manifest after creation
run: |
echo "📄 Manifest after app creation (with auto-generated ID):"
cat ${{ env.APP_PATH }}/${{ env.MANIFEST_FILE_NAME }}
- name: 📄 Create Instance
uses: screenly/cli@master
with:
screenly_api_token: ${{ env.SCREENLY_API_TOKEN }}
cli_commands: edge-app instance create --path="${{ env.APP_PATH }}" --name="${{ inputs.app_name }}"
- name: 🔄 Update Instance
uses: screenly/cli@master
with:
screenly_api_token: ${{ env.SCREENLY_API_TOKEN }}
cli_commands: edge-app instance update --path="${{ env.APP_PATH }}"
- name: 📋 Log instance.yml
run: |
cat ${{ env.APP_PATH }}/instance.yml