fix bug: no user tasks added when marketplace task is just one #110
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Dev CI/CD Pipeline | |
on: | |
push: | |
branches: [ "main" ] | |
workflow_dispatch: | |
env: | |
REGION: us-central1 | |
REPO_NAME: bittensor | |
IMAGE_NAME: sn24-vali-api | |
DEPLOYMENT_NAME: dev-sn24-vali-api | |
DEV_CLUSTER: dev-sn24-vali-api | |
NAMESPACE: dev-sn24-vali-api | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
environment: development | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get Git SHA | |
id: git_sha | |
run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
- name: Authenticate to Google Cloud | |
uses: google-github-actions/auth@v1 | |
with: | |
credentials_json: ${{ secrets.GCP_SA_KEY }} | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v1 | |
- name: Configure Docker | |
run: gcloud auth configure-docker ${{ env.REGION }}-docker.pkg.dev --quiet | |
- name: Create .env file | |
run: | | |
echo '${{ secrets.ENV_VARIABLES }}' > .env | |
- name: Build Docker image | |
run: | | |
docker build --platform=linux/amd64 \ | |
--build-arg APP_DIR=/app \ | |
-t ${{ env.REGION }}-docker.pkg.dev/${{ secrets.PROJECT_ID }}/${{ env.REPO_NAME }}/${{ env.IMAGE_NAME }}:prod-${{ steps.git_sha.outputs.sha }} . | |
- name: Push Docker image | |
run: | | |
docker push ${{ env.REGION }}-docker.pkg.dev/${{ secrets.PROJECT_ID }}/${{ env.REPO_NAME }}/${{ env.IMAGE_NAME }}:prod-${{ steps.git_sha.outputs.sha }} | |
- name: Get GKE credentials | |
uses: google-github-actions/get-gke-credentials@v1 | |
with: | |
cluster_name: ${{ env.DEV_CLUSTER }} | |
location: ${{ env.REGION }}-a | |
- name: Deploy to Dev | |
run: | | |
kubectl set image deployment/${{ env.DEPLOYMENT_NAME }} \ | |
${{ env.IMAGE_NAME }}=${{ env.REGION }}-docker.pkg.dev/${{ secrets.PROJECT_ID }}/${{ env.REPO_NAME }}/${{ env.IMAGE_NAME }}:prod-${{ steps.git_sha.outputs.sha }} \ | |
-n ${{ env.NAMESPACE }} | |
kubectl rollout status deployment/${{ env.DEPLOYMENT_NAME }} -n ${{ env.NAMESPACE }} | |
- name: Cleanup sensitive files | |
if: always() | |
run: | | |
rm -f .env |