GitHub Actions: generate wallet .env from base64 string
This commit is contained in:
@@ -57,9 +57,10 @@ jobs:
|
||||
security list-keychain -d user -s $KEYCHAIN_PATH
|
||||
|
||||
- name: Create env file
|
||||
run: |
|
||||
touch .env
|
||||
echo ADMIN_ADDRESS="${{ secrets.WALLET_ADMIN_ADDRESS }}" >> .env
|
||||
uses: timheuer/base64-to-file@v1.1
|
||||
with:
|
||||
fileName: '.env'
|
||||
encodedString: ${{ secrets.WALLET_ADMIN_ADDRESS }}
|
||||
|
||||
- name: Install app dependencies and build it
|
||||
env:
|
||||
|
||||
@@ -40,9 +40,11 @@ jobs:
|
||||
- name: Install app dependencies
|
||||
run: yarn
|
||||
- name: Create env file
|
||||
run: |
|
||||
touch .env
|
||||
echo ADMIN_ADDRESS="${{ secrets.WALLET_ADMIN_ADDRESS }}" >> .env
|
||||
uses: timheuer/base64-to-file@v1.1
|
||||
with:
|
||||
fileName: '.env'
|
||||
encodedString: ${{ secrets.WALLET_ADMIN_ADDRESS }}
|
||||
|
||||
- name: Build app
|
||||
run: yarn build
|
||||
env:
|
||||
|
||||
@@ -56,8 +56,16 @@ jobs:
|
||||
|
||||
- name: Create env file
|
||||
run: |
|
||||
touch .env
|
||||
echo ADMIN_ADDRESS="${{ secrets.WALLET_ADMIN_ADDRESS }}" >> .env
|
||||
$secretFile = Join-Path -Path $env:RUNNER_TEMP -ChildPath ".env";
|
||||
$encodedBytes = [System.Convert]::FromBase64String($env:DOT_ENV_DATA_BASE64);
|
||||
Set-Content $secretFile -Value $encodedBytes -AsByteStream;
|
||||
$secretFileHash = Get-FileHash $secretFile;
|
||||
Write-Output "::set-output name=SECRET_FILE::$secretFile";
|
||||
Write-Output "::set-output name=SECRET_FILE_HASH::$($secretFileHash.Hash)";
|
||||
Write-Output "Secret file $secretFile has hash $($secretFileHash.Hash)";
|
||||
shell: pwsh
|
||||
env:
|
||||
DOT_ENV_DATA_BASE64: ${{ secrets.WALLET_ADMIN_ADDRESS }}
|
||||
|
||||
- name: Install app dependencies
|
||||
run: yarn
|
||||
|
||||
Reference in New Issue
Block a user