Skip to content

Commit 2b7b2f1

Browse files
authored
Merge pull request #694 from The-Strategy-Unit/update_actions
2 parents a840158 + 52cdba0 commit 2b7b2f1

9 files changed

Lines changed: 31 additions & 4526 deletions

.Renviron.example

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
1-
APP_VERSION=dev
21
AZ_STORAGE_CONTAINER=inputs-data
32
AZ_STORAGE_EP=
4-
AZ_STORAGE_KEY=
5-
ENABLE_AUTO_RECONNECT=FALSE
6-
LOCAL_STORAGE_EP=
7-
LOCAL_STORAGE_KEY=
83
NHP_API_URI=
94
NHP_API_KEY=
10-
NHP_APP_VERSION=dev
11-
NHP_ENCRYPT_KEY=
125
NHP_OUTPUTS_URI=https://connect.strategyunitwm.nhs.uk/nhp/{version}/outputs/
13-
CACHE_VERSION=
146
FEEDBACK_FORM_URL=
157
YEAR_HORIZON_DEFAULT=2041
168
YEAR_HORIZON_MAX=2043
179
YEAR_BASELINE_DEFAULT=2024
1810
YEAR_BASELINE_MIN=2023
11+
CACHE_VERSION=

.github/workflows/connect-publish-manual.yaml

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@ on:
1111
environment:
1212
description: "The environment to deploy to"
1313
required: true
14-
type: choice
15-
default: "production"
16-
options:
17-
- "production"
18-
- "development"
14+
type: string
15+
default: "development"
1916
workflow_call:
2017
inputs:
2118
namespace:
@@ -28,32 +25,49 @@ on:
2825
description: "The environment to deploy to"
2926
required: true
3027
type: string
31-
default: "production"
28+
3229
jobs:
3330
connect-publish:
3431
name: "Connect Publish: ${{ inputs.namespace }} [${{ inputs.environment }}]"
3532
runs-on: ubuntu-latest
36-
environment: ${{ inputs.environment }}
33+
environment:
34+
name: ${{ inputs.environment }}
35+
url: ${{ vars.RSCONNECT_URL }}nhp/${{ inputs.namespace }}/inputs
36+
3737
steps:
3838
- uses: actions/checkout@v6
3939

40-
- name: Update manifest.json
41-
run: node update_manifest.js
40+
- uses: r-lib/actions/setup-r@v2
41+
- uses: r-lib/actions/setup-r-dependencies@v2
42+
with:
43+
cache-version: 1
44+
extra-packages: |
45+
any::rsconnect
46+
any::cpp11
47+
any::fs
48+
any::progress
49+
- name: Generate manifest
50+
run: Rscript dev/generate_manifest.R
51+
52+
- name: Upload manifest
53+
uses: actions/upload-artifact@v7
54+
with:
55+
name: manifest
56+
path: manifest.json
4257

4358
- name: Publish Connect content
4459
uses: rstudio/actions/connect-publish@main
4560
env:
4661
CONNECT_ENV_SET_AZ_STORAGE_CONTAINER: ${{ secrets.AZ_STORAGE_CONTAINER }}
4762
CONNECT_ENV_SET_AZ_STORAGE_EP: ${{ secrets.AZ_STORAGE_EP }}
4863
CONNECT_ENV_SET_NHP_API_KEY: ${{ secrets.NHP_API_KEY }}
49-
CONNECT_ENV_SET_NHP_API_URI: ${{ secrets.NHP_API_URI }}
50-
CONNECT_ENV_SET_NHP_ENCRYPT_KEY: ${{ secrets.NHP_ENCRYPT_KEY }}
64+
CONNECT_ENV_SET_NHP_API_URI: ${{ vars.NHP_API_URI }}
5165
CONNECT_ENV_SET_NHP_INPUTS_DATA_VERSION: ${{ inputs.inputs_data_version }}
5266
CONNECT_ENV_SET_NHP_OUTPUTS_URI: ${{ secrets.NHP_OUTPUTS_URI }}
5367
CONNECT_ENV_SET_FEEDBACK_FORM_URL: ${{ secrets.FEEDBACK_FORM_URL }}
5468
CONNECT_ENV_SET_GOLEM_CONFIG_ACTIVE: "production"
5569
with:
56-
url: ${{ secrets.RSCONNECT_URL }}
70+
url: ${{ vars.RSCONNECT_URL }}
5771
api-key: ${{ secrets.RSCONNECT_API_KEY }}
5872
access-type: logged_in
5973
force: true

.github/workflows/connect-publish-prod.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
with:
3636
namespace: ${{ needs.get-variables.outputs.NAMESPACE }}
3737
inputs_data_version: ${{ needs.get-variables.outputs.INPUTS_DATA_VERSION }}
38-
environment: "production"
38+
environment: "production (${{ needs.get-variables.outputs.NAMESPACE }})"
3939
secrets: inherit
4040

4141
sync-data:

.github/workflows/sync-data.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name: "Sync Data"
55
# This action uses OIDC federated credentials for authenticating with Azure.
66
#
77
# In Azure there is a managed identity which has been created and is set to allow federated
8-
# credentials from this repo when the environment is "production".
8+
# credentials from this repo when the environment is "sync-data".
99
#
1010
# That managed identity has been granted Storage Blob Data Contributor role to the storage account
1111
# which is being synced with azcopy.
@@ -41,7 +41,7 @@ jobs:
4141
sync-data:
4242
name: "Sync Data"
4343
runs-on: ubuntu-latest
44-
environment: production
44+
environment: sync-data
4545

4646
steps:
4747
- name: Azure Login

R/mod_population_growth_server.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ mod_population_growth_server <- function(id, params) {
3838
shiny::observe({
3939
if (init_timeout) {
4040
shiny::invalidateLater(50)
41-
shiny::req((init_timeout <<- FALSE))
41+
shiny::req((init_timeout <<- FALSE)) # nolint
4242
}
4343
names(
4444
params$demographic_factors$variant_probabilities

dev/generate_manifest.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,3 @@ files <- c(
77
)
88

99
rsconnect::writeManifest(appFiles = files)
10-
11-
system("node remove_files_from_manifest.js")

manifest.json

Lines changed: 0 additions & 4463 deletions
This file was deleted.

remove_files_from_manifest.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

update_manifest.js

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)