-
Notifications
You must be signed in to change notification settings - Fork 2
124 lines (117 loc) Β· 3.81 KB
/
Copy pathPROD-studios-selected.yaml
File metadata and controls
124 lines (117 loc) Β· 3.81 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
name: PROD - Deploy selected satellite studio
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'
on:
workflow_dispatch:
inputs:
site:
description: 'Name of studio to deploy'
required: true
type: choice
options:
- brazil
- germany
- argentina
- poland
- japan
- storage
- equinorfunds
- southkorea
- celticsea
- sponsorship
permissions:
id-token: write
jobs:
update-radix-config:
runs-on: ubuntu-latest
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
steps:
- name: Checkout internal ποΈ
id: checkout-internal
uses: actions/checkout@v6
with:
repository: 'equinor/energyvision-internal'
ref: main
token: ${{ secrets.PADMS_PAT }} # Replace with ssh as per https://stackoverflow.com/questions/60222741/github-actions-and-git-clone-issue
- name: Promote preprod tag to prod ποΈ
if: github.ref == 'refs/heads/main'
shell: bash
id: modify-radix
run: |
# Install pre-requisite
python3 -m venv venv
source venv/bin/activate
python -m pip install ruamel.yaml
python ci/promoteToProduction.py studio ${{ github.event.inputs.site }}
git config --global user.name 'github'
git config --global user.email 'padms@users.noreply.github.com'
git remote set-url origin https://x-access-token:${{ secrets.PADMS_PAT }}@github.com/equinor/energyvision-internal
if [[ `git status --porcelain` ]]
then
git commit -am "π Deploy ${{ github.event.inputs.site }} to production"
git pull --rebase origin main
git push origin HEAD:main
fi
- uses: act10ns/slack@v2
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
if: failure()
deploy-satellite-studios:
needs: update-radix-config
runs-on: ubuntu-latest
environment:
name: production
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
DOCKER_BUILDKIT: 1
steps:
- name: Checkout ποΈ
uses: actions/checkout@v6
# PRODUCTION CLUSTERS
- name: Deploy to Radix π
id: deploy
uses: equinor/radix-github-actions@v2
with:
azure_client_id: 460b889f-89e0-4cc9-965c-31f3e7770226
version: 'v1.37.1'
- run: rx create job deploy
--context platform2
-a equinor-web-sites
-e ${{ secrets.ENV }}
-f
shell: bash
- uses: act10ns/slack@v2
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
if: failure()
store-image-tags:
needs: deploy-satellite-studios
runs-on: ubuntu-latest
steps:
- name: Checkout internal ποΈ
id: checkout-internal
uses: actions/checkout@v6
with:
repository: 'equinor/energyvision-internal'
ref: main
token: ${{ secrets.PADMS_PAT }}
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: '24' # Or any version you prefer
- name: Install dependencies
run: |
npm install js-yaml
- name: Run script for 'studio'
run: node ci/storeImageTags.js studio
- name: Commit and push changes
run: |
git config --global user.name 'github'
git config --global user.email 'padms@users.noreply.github.com'
git remote set-url origin https://x-access-token:${{ secrets.PADMS_PAT }}@github.com/equinor/energyvision-internal
git add latest-prod-tags.json
git commit -m "Update latest-prod-tags.json with new tags" || echo "No changes to commit"
git push