Skip to content

Deploy to Development #35

Deploy to Development

Deploy to Development #35

Workflow file for this run

name: Deploy to Development
concurrency:
group: dev-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
inputs:
ttl:
description: "Deployment time to live in hours"
required: true
type: number
default: 24
jobs:
compute-sha:
name: Compute sha_short
runs-on: ubuntu-latest
outputs:
sha_short: ${{ steps.vars.outputs.sha_short }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set vars
id: vars
run: |
echo "sha_short=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV
echo "sha_short=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_OUTPUT
build-push-backend:
name: Build and Push Backend Image
runs-on: ubuntu-latest
outputs:
sha_short: ${{ steps.vars.outputs.sha_short }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set vars
id: vars
run: |
echo "sha_short=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV
echo "sha_short=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_OUTPUT
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Push Image with Tag
run: |
docker build --platform=linux/amd64 --target backend-prod --tag "${{ secrets.DOCKER_USERNAME }}/bt-backend:${{ env.sha_short }}" .
docker push "${{ secrets.DOCKER_USERNAME }}/bt-backend:${{ env.sha_short }}"
build-push-frontend:
name: Build and Push Frontend Image
runs-on: ubuntu-latest
outputs:
sha_short: ${{ steps.vars.outputs.sha_short }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set vars
id: vars
run: |
echo "sha_short=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV
echo "sha_short=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_OUTPUT
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Push Image with Tag
run: |
docker build --platform=linux/amd64 --target frontend-prod --tag "${{ secrets.DOCKER_USERNAME }}/bt-frontend:${{ env.sha_short }}" .
docker push "${{ secrets.DOCKER_USERNAME }}/bt-frontend:${{ env.sha_short }}"
deploy:
name: Deploy with SSH
needs: [compute-sha, build-push]

Check failure on line 89 in .github/workflows/cd-dev.yaml

View workflow run for this annotation

GitHub Actions / Deploy to Development

Invalid workflow file

The workflow is not valid. .github/workflows/cd-dev.yaml (Line: 89, Col: 26): Job 'deploy' depends on unknown job 'build-push'.
runs-on: ubuntu-latest
environment: development
steps:
- name: SSH and Helm Install
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: root
key: ${{ secrets.SSH_KEY }}
script: |
cd ./infra
helm uninstall bt-dev-app-${{ needs.compute-sha.outputs.sha_short }} || true
helm install bt-dev-app-${{ needs.compute-sha.outputs.sha_short }} ./app --namespace=bt \
--set env=dev \
--set ttl=${{ inputs.ttl }} \
--set frontend.image.tag=${{ needs.compute-sha.outputs.sha_short }} \
--set backend.image.tag=${{ needs.compute-sha.outputs.sha_short }} \
--set host=${{ needs.compute-sha.outputs.sha_short }}.stanfurdtime.com \
--set mongoUri=mongodb://bt-dev-mongo-mongodb.bt.svc.cluster.local:27017/bt \
--set redisUri=redis://bt-dev-redis-master.bt.svc.cluster.local:6379 \
--set nodeEnv=development