Merge pull request #12 from tokamak-network/feat/OR-1800-add-unit-tests #9
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 thanos-event-listener (nightly) | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
version: | |
name: Publish Packages (nightly) | |
runs-on: ubuntu-latest | |
# map the step outputs to job outputs | |
outputs: | |
nightly-docker-tag: ${{ steps.docker-image-name.outputs.nightly-docker-tag }} | |
steps: | |
- name: Check out source code | |
uses: actions/checkout@v4 | |
with: | |
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits | |
repository: tokamak-network/tokamak-thanos-event-listener | |
fetch-depth: 0 | |
- name: Docker Image Name | |
id: docker-image-name | |
run: | | |
echo "nightly-docker-tag=nightly-${GITHUB_SHA::8}" >> "$GITHUB_OUTPUT" | |
thanos-event-listener: | |
name: Publish thanos-event-listener | |
needs: [version] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_SECRET }} | |
- name: Build and Push | |
uses: docker/build-push-action@v5 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: tokamaknetwork/thanos-event-listener:${{ needs.version.outputs.nightly-docker-tag }} | |
update-kustomize: | |
name: Update image version in kustomize manifest file (nightly) | |
needs: [version, thanos-event-listener] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: tokamak-network/tokamak-infra | |
ref: main | |
token: ${{ secrets.ACCESS_TOKEN }} | |
path: tokamak-infra | |
- name: Setup Kustomize | |
uses: imranismail/setup-kustomize@v1 | |
with: | |
github-token: ${{ secrets.ACCESS_TOKEN }} | |
- name: Update notif_thanos Kubernetes resources | |
run: | | |
cd tokamak-infra/apps/notif_thanos/kustomize/overlays/aws/thanos-sepolia | |
kustomize edit set image tokamaknetwork/thanos-event-listener:${{ needs.version.outputs.nightly-docker-tag}} | |
- name: Show updated Kubernetes resources | |
run: | | |
cd tokamak-infra/apps/notif_thanos/kustomize/overlays/aws/thanos-sepolia | |
cat kustomization.yml | |
- name: Commit and push changes | |
uses: EndBug/add-and-commit@v9 | |
with: | |
default_author: github_actions | |
github_token: ${{ secrets.ACCESS_TOKEN }} | |
message: '[AUTO] Update thanos-event-listener images tag for sepolia' | |
cwd: 'tokamak-infra/' |