feat: support polling logs via http connection (#96) #37
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: Publish | |
on: | |
push: | |
branches: | |
- develop | |
tags: | |
- "v*" | |
# Cancel any in-progress CI runs for a PR if it is updated | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-image: | |
runs-on: ubuntu-latest | |
environment: publish | |
permissions: | |
id-token: write | |
contents: write | |
actions: read | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
- name: Configure aws creds | |
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 | |
with: | |
role-to-assume: ${{ secrets.AWS_OIDC_IAM_ROLE_ARN }} | |
role-duration-seconds: 900 | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Login to aws ecr | |
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1 | |
with: | |
registries: ${{ secrets.AWS_ACCOUNT_NUMBER }} | |
- uses: smartcontractkit/tool-versions-to-env-action@aabd5efbaf28005284e846c5cf3a02f2cba2f4c2 # v1.0.8 | |
id: tool-versions | |
- name: Setup go ${{ steps.tool-versions.outputs.golang_version }} | |
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | |
with: | |
go-version: ${{ steps.tool-versions.outputs.golang_version }} | |
- name: Setup docker buildx | |
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0 | |
- name: Extract Docker metadata | |
id: meta | |
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 | |
with: | |
images: ${{ secrets.AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/timelock-worker | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=sha,enable=true,priority=100,prefix=sha-,suffix=,format=short | |
type=semver,pattern={{version}} | |
- name: Docker build and push | |
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0 | |
with: | |
context: . | |
file: builds/Dockerfile | |
push: true | |
labels: ${{ steps.meta.outputs.labels }} | |
tags: ${{ steps.meta.outputs.tags }} |