Skip to content

remove init status #213

remove init status

remove init status #213

Workflow file for this run

name: Deploy Mina Names
on:
pull_request:
branches:
- main
- t-names
workflow_dispatch:
inputs:
environment:
type: choice
options:
- main
- t-names
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkout GitHub Actions
uses: actions/checkout@v3
with:
repository: Staketab/github-actions
path: .github/actions
token: ${{ secrets.GH_TOKEN }}
- name: calculate environment
shell: bash
run: |
dispatch_branch=${{ github.event.inputs.environment }}
pull_request_branch=${GITHUB_BASE_REF#refs/heads/}
echo "ENVIRONMENT=${pull_request_branch:-$dispatch_branch}" >> $GITHUB_ENV
- name: Settings
uses: kanga333/[email protected]
id: settings
with:
key: ${{ env.ENVIRONMENT }}
map: |
{
"^t-names$": {
"node_env": "development",
"webroot": "/var/www/test/names",
"ssh_hostname": "${{ secrets.FRONT_SCORE_IP }}",
"ssh_password": "${{ secrets.FRONT_SCORE_SSH }}",
"systemd_service": "names-test.service"
},
"^main$": {
"node_env": "production",
"webroot": "/var/www/prod/names",
"ssh_hostname": "${{ secrets.FRONT_SCORE_IP }}",
"ssh_password": "${{ secrets.FRONT_SCORE_SSH }}",
"systemd_service": "names.service"
}
}
export_to: output,log
mode: fill
- name: generate .env
run: |
cat > ui/.env <<-EOF
Non_NEXT_PUBLIC_API_URL=${{ secrets.NEXT_PUBLIC_API_URL }}
Non_NEXT_PUBLIC_API_KEY=${{ secrets.NEXT_PUBLIC_API_KEY }}
NEXT_PUBLIC_IPFS_URL=${{ secrets.NEXT_PUBLIC_IPFS_URL }}
NEXT_PUBLIC_IPFS_KEY=${{ secrets.NEXT_PUBLIC_IPFS_KEY }}
Non_NEXT_PUBLIC_ZKCLOUDWORKER_AUTH=${{ secrets.NEXT_PUBLIC_ZKCLOUDWORKER_AUTH }}
Non_NEXT_PUBLIC_ZKCLOUDWORKER_JWR_TOKEN=${{ secrets.NEXT_PUBLIC_ZKCLOUDWORKER_JWR_TOKEN }}
Non_NEXT_PUBLIC_ZKCLOUDWORKER_ENDPOINT=${{ secrets.NEXT_PUBLIC_ZKCLOUDWORKER_ENDPOINT }}
EOF
- name: Deploy
uses: ./.github/actions/mina-names
with:
workdir: ui
webroot: ${{ steps.settings.outputs.webroot }}
systemd_service: ${{ steps.settings.outputs.systemd_service }}
ssh_hostname: ${{ steps.settings.outputs.ssh_hostname }}
ssh_username: ${{ secrets.SERVER_USERNAME }}
ssh_password: ${{ steps.settings.outputs.ssh_password }}
github_token: ${{ secrets.GH_TOKEN }}
env:
REACT_APP_ENVIRONMENT: ${{ steps.settings.outputs.node_env }}