update otel collector to v110 (#186) #12
This file contains 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: 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 | |