feat(ci): support fairground / mainnet variables for s3 and do not deploy trading to s3 bucket on main branch
This commit is contained in:
parent
70e172045d
commit
7a06c946d1
50
.github/workflows/publish-dist.yml
vendored
50
.github/workflows/publish-dist.yml
vendored
@ -59,29 +59,39 @@ jobs:
|
|||||||
key: ${{ runner.os }}-cache-node-modules-${{ hashFiles('yarn.lock') }}
|
key: ${{ runner.os }}-cache-node-modules-${{ hashFiles('yarn.lock') }}
|
||||||
|
|
||||||
# https://docs.github.com/en/actions/learn-github-actions/contexts
|
# https://docs.github.com/en/actions/learn-github-actions/contexts
|
||||||
- name: Define variables
|
- name: Define dist variables
|
||||||
|
if: ${{ github.event_name == 'push' }}
|
||||||
run: |
|
run: |
|
||||||
envName=''
|
envName=''
|
||||||
domain="vega.rocks"
|
domain="vega.rocks"
|
||||||
if [[ "${{ github.event_name }}" = "push" ]]; then
|
bucketName=''
|
||||||
if [[ "${{ github.ref }}" =~ .*release/.* ]]; then
|
|
||||||
envName="$(echo ${{ github.ref }} | rev | cut -d '/' -f 1 | rev)"
|
if [[ "${{ github.ref }}" =~ .*release/.* ]]; then
|
||||||
elif [[ "${{ github.ref }}" =~ .*develop$ ]]; then
|
envName="$(echo ${{ github.ref }} | rev | cut -d '/' -f 1 | rev)"
|
||||||
envName="stagnet1"
|
elif [[ "${{ github.ref }}" =~ .*develop$ ]]; then
|
||||||
elif [[ "${{ matrix.app}}" = "trading" ]] && [[ ${{ startsWith(github.ref, 'refs/tags/v') && 'true' || 'false' }} = "true" ]]; then
|
envName="stagnet1"
|
||||||
envName="mainnet"
|
elif [[ "${{ github.ref }}" =~ .*main$ ]]; then
|
||||||
elif [[ "${{ github.ref }}" =~ .*main$ ]]; then
|
envName="mainnet"
|
||||||
envName="mainnet"
|
elif [[ "${{ matrix.app}}" = "trading" ]] && [[ "${{ startsWith(github.ref, 'refs/tags/v') && 'true' || 'false' }}" = "true" ]]; then
|
||||||
fi
|
envName="mainnet"
|
||||||
if [[ "${envName}" = "mainnet" ]]; then
|
|
||||||
domain="vega.xyz"
|
|
||||||
fi
|
|
||||||
if [[ "${envName}" = "testnet" ]]; then
|
|
||||||
domain="fairground.wtf"
|
|
||||||
fi
|
|
||||||
bucketName="${{ matrix.app }}.${envName}.${domain}"
|
|
||||||
echo BUCKET_NAME=${bucketName} >> $GITHUB_ENV
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "${envName}" = "mainnet" ]]; then
|
||||||
|
domain="vega.xyz"
|
||||||
|
bucketName="${{ matrix.app }}.${domain}"
|
||||||
|
elif [[ "${envName}" = "testnet" ]]; then
|
||||||
|
domain="fairground.wtf"
|
||||||
|
bucketName="${{ matrix.app }}.${domain}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "${bucketName}" ]]; then
|
||||||
|
bucketName="${{ matrix.app }}.${envName}.${domain}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "bucket name: ${bucketName}"
|
||||||
|
echo "env name: ${envName}"
|
||||||
|
|
||||||
|
echo BUCKET_NAME=${bucketName} >> $GITHUB_ENV
|
||||||
echo ENV_NAME=${envName} >> $GITHUB_ENV
|
echo ENV_NAME=${envName} >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Build local dist
|
- name: Build local dist
|
||||||
@ -158,7 +168,7 @@ jobs:
|
|||||||
# bucket creation in github.com/vegaprotocol/terraform//frontend
|
# bucket creation in github.com/vegaprotocol/terraform//frontend
|
||||||
- name: Publish dist to s3
|
- name: Publish dist to s3
|
||||||
uses: jakejarvis/s3-sync-action@master
|
uses: jakejarvis/s3-sync-action@master
|
||||||
if: ${{ github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/v') }}
|
if: ${{ github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/v') && ( matrix.app != 'trading' || (matrix.app == 'trading' && !endsWith(github.ref, 'main') ) ) }}
|
||||||
with:
|
with:
|
||||||
args: --acl private --follow-symlinks --delete
|
args: --acl private --follow-symlinks --delete
|
||||||
env:
|
env:
|
||||||
|
Loading…
Reference in New Issue
Block a user