Skip to content

Commit

Permalink
[ci] update vars for swarm build
Browse files Browse the repository at this point in the history
  • Loading branch information
darkobas2 committed Oct 8, 2023
1 parent 4fb3f07 commit 649d5a7
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 20 deletions.
19 changes: 3 additions & 16 deletions .github/workflows/swarm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ on:
push:
branches:
- master
- development
- staging

jobs:
build:
Expand All @@ -24,21 +22,10 @@ jobs:
- name: Set environment specific variables
uses: jnus/[email protected]
with:
scope: ${{ github.ref_name }}
scope: "swarm"
configFile: '.github/workflows/variables.json'
secrets: '${{ toJson(secrets.github_token) }}'

- name: set vars per branch
id: vars
run: |
if [ "$GITHUB_REF_NAME" == 'master' ]; then
echo "REACT_APP_BACKEND_BASE_URL=https://fairdrive.fairdatasociety.org/apps/dracula/" >> "$GITHUB_ENV"
echo "REACT_APP_FRONTEND_ASSETS_URL=https://fairdrive.fairdatasociety.org/apps/dracula/" >> "$GITHUB_ENV"
elif [ "$GITHUB_REF_NAME" == 'development' ]; then
echo "REACT_APP_BACKEND_BASE_URL=https://fairdrive.dev.fairdatasociety.org/apps/dracula/" >> "$GITHUB_ENV"
echo "REACT_APP_FRONTEND_ASSETS_URL=https://fairdrive.dev.fairdatasociety.org/apps/dracula/" >> "$GITHUB_ENV"
fi
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
Expand Down Expand Up @@ -68,7 +55,7 @@ jobs:
CI: false
- name: copy mock-backend to root
run: |
cp -R ./build/mock-backend/* ./build/
mv ./build/mock-backend/* ./build/
find * -type f -exec sed -i 's#https://app.dracula.fairdatasociety.org/#'"$REACT_APP_BACKEND_BASE_URL"'#g' {} +
- name: Upload
id: swarm-upload
Expand All @@ -88,7 +75,7 @@ jobs:
bee-url: ${{ env.SWARM_URL }}
reference: ${{ steps.swarm-upload.outputs.reference }}
topic: consents
signer: ${{ secrets[env.SIGNER] }}
signer: ${{ secrets.SIGNER_master }}
- name: get CID
id: swarm-cid
uses: ethersphere/swarm-actions/reference-to-cid@latest
Expand Down
51 changes: 47 additions & 4 deletions .github/workflows/variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"Value": ".",
"Scope": {
"Environment": [
"master"
"master",
"swarm"
]
}
},
Expand All @@ -31,7 +32,21 @@
{
"Name": "REACT_APP_FAIRDRIVEHOST",
"Value": "https://app.fairdrive#{DEPLOYMENT}fairdatasociety.org",
"Scope": {}
"Scope": {
"Environment": [
"master",
"development"
]
}
},
{
"Name": "REACT_APP_FAIRDRIVEHOST",
"Value": "https://app#{DEPLOYMENT}fairdrive.io",
"Scope": {
"Environment": [
"swarm"
]
}
},
{
"Name": "REACT_APP_BEE_URL",
Expand All @@ -51,12 +66,40 @@
{
"Name": "REACT_APP_BACKEND_BASE_URL",
"Value": "https://app.dracula#{DEPLOYMENT}fairdatasociety.org/",
"Scope": {}
"Scope": {
"Environment": [
"master",
"development"
]
}
},
{
"Name": "REACT_APP_FRONTEND_ASSETS_URL",
"Value": "https://app.dracula#{DEPLOYMENT}fairdatasociety.org/",
"Scope": {}
"Scope": {
"Environment": [
"master",
"development"
]
}
},
{
"Name": "REACT_APP_BACKEND_BASE_URL",
"Value": "https://dracula#{DEPLOYMENT}fairdrive.io/",
"Scope": {
"Environment": [
"swarm"
]
}
},
{
"Name": "REACT_APP_FRONTEND_ASSETS_URL",
"Value": "https://dracula#{DEPLOYMENT}fairdrive.io/",
"Scope": {
"Environment": [
"swarm"
]
}
},
{
"Name": "PURGE_URL",
Expand Down

0 comments on commit 649d5a7

Please sign in to comment.