-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from tokamak-network/OR-1691-thanos-event-liste…
…ner-deploy-github-action-CI Or 1691 thanos event listener deploy GitHub action ci
- Loading branch information
Showing
2 changed files
with
94 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
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/sepolia-nightly | ||
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/sepolia-nightly | ||
cat kustomization.yaml | ||
- 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-nightly' | ||
cwd: 'tokamak-infra/' |
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