Skip to content

Merge pull request #471 from dtm-labs/alpha #127

Merge pull request #471 from dtm-labs/alpha

Merge pull request #471 from dtm-labs/alpha #127

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*.*.*'
jobs:
release:
name: Release on GitHub
runs-on: ubuntu-latest
steps:
- name: Get Release Version
run: |
export RELEASE_VERSION=${GITHUB_REF#refs/*/}
echo RELEASE_VERSION: ${RELEASE_VERSION}
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV
- name: Check out code
uses: actions/checkout@v3
- name: Validates GO releaser config
uses: docker://goreleaser/goreleaser:v1.7.0
with:
args: check
- name: Create release on GitHub
uses: docker://goreleaser/goreleaser:v1.7.0
with:
args: release -f helper/.goreleaser.yml --rm-dist
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 14
- name: Build admin
run: |
cd admin
npm install -g yarn
yarn
VITE_ADMIN_VERSION=${{ env.RELEASE_VERSION }} yarn build
cd ..
- name: Scp admin
env:
host: '[email protected]'
host2: '[email protected]'
dest: '/data/dtm-admin/'
run: |
cd admin
echo "${{secrets.DEPLOY_KEY}}" > deploy_key
chmod 600 ./deploy_key
tar -cvzf dist.tar.gz dist
scp -i deploy_key -o StrictHostKeyChecking=no dist.tar.gz ${{env.host}}:${{env.dest}}
ssh -i deploy_key -o StrictHostKeyChecking=no ${{env.host}} 'cd ${{env.dest}} && tar -zvxf dist.tar.gz'
scp -i deploy_key -o StrictHostKeyChecking=no dist.tar.gz ${{env.host2}}:${{env.dest}}
ssh -i deploy_key -o StrictHostKeyChecking=no ${{env.host2}} 'cd ${{env.dest}} && tar -zvxf dist.tar.gz'
rm deploy_key dist.tar.gz
echo > dist/placeholder
cd ..