Skip to content

chore(deps): Bump the opentelemetry group across 1 directory with 3 updates #545

chore(deps): Bump the opentelemetry group across 1 directory with 3 updates

chore(deps): Bump the opentelemetry group across 1 directory with 3 updates #545

Workflow file for this run

name: Deploy
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
id-token: write
packages: write
env:
CARGO_TERM_COLOR: always
HANDLER_NAME: rex
IMAGE: sierrasoftworks/rex
STAGING_DEPLOYMENT_APP_ID: e0d46426-bd93-4bb2-9b5a-cabb0af9a509
STAGING_FUNCTION_NAME: rex-sierrasoftworks-staging
STAGING_HEALTHCHECK: "https://rex-staging.sierrasoftworks.com/api/v1/health"
LIVE_DEPLOYMENT_APP_ID: 25c19850-5c4e-4b6e-9257-a6e62b31e2e7
LIVE_FUNCTION_NAME: rex-sierrasoftworks
LIVE_HEALTHCHECK: "https://rex.sierrasoftworks.com/api/v1/health"
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Build Dockerfile
run: docker build . --file Dockerfile --tag image
- run: |
docker run --rm -t -v $PWD:/volume image cp /app/$HANDLER_NAME /volume/handler
mv ./handler ./$HANDLER_NAME
- name: Save handler artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.HANDLER_NAME }}
path: ${{ env.HANDLER_NAME }}
- name: Log into registries
if: github.event_name == 'push'
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
echo "${{ secrets.DOCKER_HUB }}" | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
- name: Calculate version number
id: version
if: github.event_name == 'push'
run: |
VERSION=$(git describe --tags 2>/dev/null || git rev-parse --short HEAD)
echo "::set-output name=version::$VERSION"
- name: Push image to GitHub
if: github.event_name == 'push'
run: |
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/${{ github.event.repository.name }}
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
docker tag image $IMAGE_ID:latest
docker push $IMAGE_ID:latest
docker tag image $IMAGE_ID:${{ steps.version.outputs.version }}
docker push $IMAGE_ID:${{ steps.version.outputs.version }}
- name: Push image to Docker Hub
if: github.event_name == 'push'
run: |
IMAGE_ID=${{ env.IMAGE }}
echo IMAGE_ID=$IMAGE_ID
docker tag image $IMAGE_ID:latest
docker push $IMAGE_ID:latest
docker tag image $IMAGE_ID:${{ steps.version.outputs.version }}
docker push $IMAGE_ID:${{ steps.version.outputs.version }}
deploy-staging:
needs: build
runs-on: ubuntu-20.04
if: github.actor != 'dependabot[bot]'
environment:
name: Staging
url: ${{ env.STAGING_HEALTHCHECK }}
steps:
- uses: actions/checkout@v4
- name: Fetch handler artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.HANDLER_NAME }}
- name: 'Login via Azure CLI'
uses: azure/login@v2
with:
tenant-id: a26571f1-22b3-4756-ac7b-39ca684fab48
subscription-id: 108b3ddb-53fb-4344-80b2-d6c151912be6
client-id: ${{ env.STAGING_DEPLOYMENT_APP_ID }}
- name: 'Run Azure Functions Action'
uses: Azure/functions-action@v1
with:
app-name: ${{ env.STAGING_FUNCTION_NAME }}
respect-funcignore: 'true'
healthcheck-staging:
needs: deploy-staging
runs-on: ubuntu-20.04
steps:
- name: Probe
uses: Jtalk/url-health-check-action@v4
with:
url: ${{ env.STAGING_HEALTHCHECK }}
max-attempts: 5
retry-delay: 10s
follow-redirect: true
deploy-live:
needs: healthcheck-staging
if: github.event_name == 'push'
environment:
name: Production
url: ${{ env.LIVE_HEALTHCHECK }}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Fetch handler artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.HANDLER_NAME }}
- name: 'Login via Azure CLI'
uses: azure/login@v2
with:
tenant-id: a26571f1-22b3-4756-ac7b-39ca684fab48
subscription-id: 108b3ddb-53fb-4344-80b2-d6c151912be6
client-id: ${{ env.LIVE_DEPLOYMENT_APP_ID }}
- name: 'Run Azure Functions Action'
uses: Azure/functions-action@v1
with:
app-name: ${{ env.LIVE_FUNCTION_NAME }}
respect-funcignore: 'true'
healthcheck-live:
needs: deploy-live
runs-on: ubuntu-20.04
steps:
- name: Probe
uses: Jtalk/url-health-check-action@v4
with:
url: ${{ env.LIVE_HEALTHCHECK }}
max-attempts: 5
retry-delay: 10s
follow-redirect: true