Skip to content

Merge pull request #211 from Pyrrha-Platform/dependabot/npm_and_yarn/… #87

Merge pull request #211 from Pyrrha-Platform/dependabot/npm_and_yarn/…

Merge pull request #211 from Pyrrha-Platform/dependabot/npm_and_yarn/… #87

Workflow file for this run

name: Build and Deploy Dev
# Execute on every push to master
on:
workflow_dispatch:
push: # Execute on every push to the master branch. Merging a pull request counts as a push.
branches:
- main
# Environment variables available to all jobs and steps in this workflow
env:
GITHUB_SHA: ${{ github.sha }}
IBM_CLOUD_API_KEY: ${{ secrets.IBM_CLOUD_API_KEY_DEV }}
IBM_CLOUD_REGION: ${{ secrets.IBM_CLOUD_REGION_DEV }}
IBM_CLOUD_RESOURCE_GROUP: ${{ secrets.IBM_CLOUD_RESOURCE_GROUP_DEV }}
ICR_REGION: ${{ secrets.ICR_REGION_DEV }}
ICR_NAMESPACE: ${{ secrets.ICR_NAMESPACE_DEV }}
ICR_REGISTRY_HOSTNAME: ${{secrets.ICR_REGISTRY_HOSTNAME_DEV}}
IKS_CLUSTER: ${{ secrets.IKS_CLUSTER_DEV }}
K8S_CLUSTER_NAMESPACE: ${{ secrets.K8S_CLUSTER_NAMESPACE_DEV }}
IKS_DEPLOYMENT_NAME: ${{ secrets.IKS_DEPLOYMENT_NAME_DEV }}
CONTAINER_NAME: ${{ secrets.CONTAINER_NAME_DEV }}
IMAGE_NAME: ${{ secrets.IMAGE_NAME_DEV }}
jobs:
setup-build-publish-deploy:
name: Setup, Build, Publish, and Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Add VCAP_LOCAL_DEV from secret to development environment
env:
VCAP_LOCAL: ${{ secrets.VCAP_LOCAL_DEV }}
run: |
echo "$VCAP_LOCAL" >> ./pyrrha-dashboard/api-auth/vcap-local.json
# A GitHub Action for serializing workflow runs
- name: Turnstyle
uses: softprops/turnstyle@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update environment args for Docker Build
env:
REACT_APP_WEBSOCKET_URL: ${{secrets.REACT_APP_WEBSOCKET_URL_DEV}}
REACT_APP_MAPBOX_ACCESS_TOKEN: ${{secrets.REACT_APP_MAPBOX_ACCESS_TOKEN_DEV}}
run: |
sed -i "s|PYRRHA_WS_URL|$REACT_APP_WEBSOCKET_URL|" ./pyrrha-dashboard/Dockerfile
sed -i "s|PYRRHA_MAPBOX_TOKEN|$REACT_APP_MAPBOX_ACCESS_TOKEN|" ./pyrrha-dashboard/Dockerfile
grep -i "REACT_APP" ./pyrrha-dashboard/Dockerfile
- name: Deploy api-main
uses: call-for-code/build-push-deploy@main
with:
cloud-api-key: $IBM_CLOUD_API_KEY
cloud-region: $IBM_CLOUD_REGION
icr-region: $ICR_REGION
cloud-resource-group: $IBM_CLOUD_RESOURCE_GROUP
deployment-name: api-main
container-name: api-main
github-sha: $GITHUB_SHA
icr-namespace: $ICR_NAMESPACE
image-name: api-main
k8s-cluster-name: $IKS_CLUSTER
k8s-cluster-namespace: $K8S_CLUSTER_NAMESPACE
registry-hostname: $ICR_REGISTRY_HOSTNAME
working-directory: "pyrrha-dashboard/api-main"
- name: Deploy api-auth
uses: call-for-code/build-push-deploy@938a160985387d0b683b4319d0daf4ec6732b763
with:
cloud-api-key: $IBM_CLOUD_API_KEY
cloud-region: $IBM_CLOUD_REGION
icr-region: $ICR_REGION
cloud-resource-group: $IBM_CLOUD_RESOURCE_GROUP
deployment-name: api-auth
container-name: api-auth
github-sha: $GITHUB_SHA
icr-namespace: $ICR_NAMESPACE
image-name: api-auth
k8s-cluster-name: $IKS_CLUSTER
k8s-cluster-namespace: $K8S_CLUSTER_NAMESPACE
registry-hostname: $ICR_REGISTRY_HOSTNAME
working-directory: "pyrrha-dashboard/api-auth"
- name: Deploy dash
uses: call-for-code/build-push-deploy@938a160985387d0b683b4319d0daf4ec6732b763
with:
cloud-api-key: $IBM_CLOUD_API_KEY
cloud-region: $IBM_CLOUD_REGION
icr-region: $ICR_REGION
cloud-resource-group: $IBM_CLOUD_RESOURCE_GROUP
deployment-name: dash
container-name: dash
github-sha: $GITHUB_SHA
icr-namespace: $ICR_NAMESPACE
image-name: dash
k8s-cluster-name: $IKS_CLUSTER
k8s-cluster-namespace: $K8S_CLUSTER_NAMESPACE
registry-hostname: $ICR_REGISTRY_HOSTNAME
working-directory: "pyrrha-dashboard"