Skip to content

fixed failing deployments in ci/cd #18

fixed failing deployments in ci/cd

fixed failing deployments in ci/cd #18

Workflow file for this run

name: deploy bit-bot
# On pull request, make a deployment to Preview
# On merge into main, make a deployment to Develop
# On merge into prod, flag prod, make a deployment to Production
on:
push:
branches: [main, production]
pull_request:
branches: [main]
permissions:
id-token: write
contents: read
deployments: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set pipeline
id: pipeline
# if its a PR, then its for preview, else its for development or prod based on what it's being pushed to.
run: echo ::set-output name=pipeline::${{ github.event_name == 'pull_request' && 'Preview' || (github.ref == 'refs/heads/production' && 'Production' || 'Development') }}
- uses: chrnorm/deployment-action@releases/v1
name: Create GitHub deployment
id: deployment
with:
token: "${{ github.token }}"
environment: ${{ steps.pipeline.outputs.pipeline }}
target_url: ""
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: bitsofgood/bit-bot:latest
- name: Azure login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Deploy to Azure App Service
uses: azure/webapps-deploy@v2
with:
app-name: ${{ secrets.AZURE_APP_NAME }}
images: bitsofgood/bit-bot:latest
- name: Update deployment status (success)
if: success()
uses: chrnorm/deployment-status@releases/v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
target_url: ${{ steps.vercel_deploy.outputs.preview-url }}
environment_url: ${{ steps.vercel_deploy.outputs.preview-url }}
state: "success"
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
- name: Update deployment status (failure)
if: failure()
uses: chrnorm/deployment-status@releases/v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
target_url: ${{ steps.vercel_deploy.outputs.preview-url }}
environment_url: ${{ steps.vercel_deploy.outputs.preview-url }}
state: "failure"
deployment_id: ${{ steps.deployment.outputs.deployment_id }}