Skip to content

Merge pull request #312 from tokamak-network/feat/release-sdk-v0.0.13 #204

Merge pull request #312 from tokamak-network/feat/release-sdk-v0.0.13

Merge pull request #312 from tokamak-network/feat/release-sdk-v0.0.13 #204

name: Publish Docker images (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
fetch-depth: 0
- name: Docker Image Name
id: docker-image-name
run: |
echo "nightly-docker-tag=nightly-${GITHUB_SHA::8}" >> "$GITHUB_OUTPUT"
op-stack-go:
name: Publish op-stack-go
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: Set build args
id: build_args
run: |
echo "GITDATE=$(date +%d-%m-%Y)" >> "$GITHUB_OUTPUT"
echo "GITCOMMIT=$GITHUB_SHA" >> "$GITHUB_OUTPUT"
- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
context: .
file: ./ops/docker/op-stack-go/Dockerfile
push: true
tags: tokamaknetwork/thanos-op-stack-go:${{ needs.version.outputs.nightly-docker-tag }}
build-args: |
GITDATE=${{ steps.build_args.outputs.GITDATE }}
GITCOMMIT=${{ steps.build_args.outputs.GITCOMMIT }}
op-packages:
name: Publish ${{ matrix.target }}
needs: [op-stack-go, version]
runs-on: ubuntu-latest
strategy:
matrix:
target:
[
cannon,
op-program,
op-heartbeat,
op-wheel,
op-node,
op-challenger,
op-dispute-mon,
op-batcher,
op-proposer,
op-conductor,
da-server,
]
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@v6
with:
platforms: linux/amd64,linux/arm64
context: .
file: ./ops/docker/op-stack-go/Dockerfile
target: ${{ matrix.target }}-target
push: true
tags: tokamaknetwork/thanos-${{ matrix.target }}:${{ needs.version.outputs.nightly-docker-tag }}
etc:
name: Publish ${{ matrix.target }}
needs: [version]
runs-on: ubuntu-latest
strategy:
matrix:
target: [indexer, op-exporter, proxyd]
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: Set build args
id: build_args
run: |
echo "GITDATE=$(date +%d-%m-%Y)" >> "$GITHUB_OUTPUT"
echo "GITVERSION=$(jq -r .version ./${{ matrix.target }}/package.json)" >> "$GITHUB_OUTPUT"
echo "GITCOMMIT=$GITHUB_SHA" >> "$GITHUB_OUTPUT"
- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
context: .
file: ./${{ matrix.target }}/Dockerfile
push: true
tags: tokamaknetwork/thanos-${{ matrix.target }}:${{ needs.version.outputs.nightly-docker-tag }}
build-args: |
GITDATE=${{ steps.build_args.outputs.GITDATE }}
GITCOMMIT=${{ steps.build_args.outputs.GITCOMMIT }}
GITVERSION=${{ steps.build_args.outputs.GITVERSION }}
chain-mon-amd64:
name: Publish ${{ matrix.target }}
needs: [version]
runs-on: ubuntu-latest
strategy:
matrix:
target: [fault-mon, balance-mon, drippie-mon, wd-mon, replica-mon]
steps:
- name: Checkout
uses: actions/checkout@v4
- 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@v6
with:
context: .
file: ./ops/docker/Dockerfile.packages
target: ${{ matrix.target }}
push: true
provenance: false
tags: tokamaknetwork/thanos-${{ matrix.target }}:${{ needs.version.outputs.nightly-docker-tag }}
update-kustomize:
name: Update image version in kustomize manifest file(nightly)
needs:
- version
- etc
- op-packages
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@v2
with:
github-token: ${{ secrets.ACCESS_TOKEN }}
- name: Update thanos-op-node Kubernetes resources
run: |
cd tokamak-infra/thanos/overlays/thanos-sepolia
kustomize edit set image tokamaknetwork/thanos-op-node:${{ needs.version.outputs.nightly-docker-tag}}
- name: Update thanos-op-proposer Kubernetes resources
run: |
cd tokamak-infra/thanos/overlays/thanos-sepolia
kustomize edit set image tokamaknetwork/thanos-op-proposer:${{ needs.version.outputs.nightly-docker-tag}}
- name: Update thanos-op-batcher Kubernetes resources
run: |
cd tokamak-infra/thanos/overlays/thanos-sepolia
kustomize edit set image tokamaknetwork/thanos-op-batcher:${{ needs.version.outputs.nightly-docker-tag}}
- name: Update thanos-proxyd Kubernetes resources
run: |
cd tokamak-infra/thanos/overlays/thanos-sepolia
kustomize edit set image tokamaknetwork/thanos-proxyd:${{ needs.version.outputs.nightly-docker-tag}}
- name: Show updated Kubernetes resources
run: |
cd tokamak-infra/thanos/overlays/thanos-sepolia
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 tokamak-thanos images tag for sepolia'
cwd: 'tokamak-infra/'