diff --git a/.github/workflows/swarm.yml b/.github/workflows/swarm.yml index d14a7ff..d674004 100644 --- a/.github/workflows/swarm.yml +++ b/.github/workflows/swarm.yml @@ -4,8 +4,6 @@ on: push: branches: - master - - development - - staging jobs: build: @@ -24,21 +22,10 @@ jobs: - name: Set environment specific variables uses: jnus/json-variables@v1.0 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 @@ -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 @@ -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 diff --git a/.github/workflows/variables.json b/.github/workflows/variables.json index e5a54e6..5feff58 100644 --- a/.github/workflows/variables.json +++ b/.github/workflows/variables.json @@ -5,7 +5,8 @@ "Value": ".", "Scope": { "Environment": [ - "master" + "master", + "swarm" ] } }, @@ -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", @@ -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",