Skip to content

update otel collector to v110 (#186) #12

update otel collector to v110 (#186)

update otel collector to v110 (#186) #12

name: Deploy otel-gateway
on:
push:
branches: [main]
paths:
- "services/otel-gateway/**"
workflow_dispatch:
env:
SSH_AUTH_SOCK: /tmp/agent.sock
IMAGE_NAME: otel-gateway
IMAGE_ID: ghcr.io/opensafely-core/otel-gateway
permissions:
packages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # 3.1.0
- uses: "opensafely-core/setup-action@v1"
with:
install-just: true
- name: build Image
run: env -C services/otel-gateway just build
- name: test
run: env -C services/otel-gateway just test-ci
- name: Log into GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push image to GitHub Container Registry
run: |
docker tag $IMAGE_NAME $IMAGE_ID:latest
docker push $IMAGE_ID:latest
- name: Setup SSH Agent
run: |
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.DOKKU4_DEPLOY_SSH_KEY }}"
- name: Deploy
run: |
SHA=$(docker inspect --format='{{index .RepoDigests 0}}' $IMAGE_ID:latest)
ssh -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" [email protected] git:from-image otel-gateway $SHA