Release Processor Images #21
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: Release Processor Images | |
on: | |
workflow_call: | |
inputs: | |
processor_language: | |
required: true | |
type: string | |
default: rust | |
version_tag: | |
required: false | |
type: string | |
description: After we copy the image from GAR to DockerHub, we will add this tag to the image. For example aptos-indexer-processors-v1.0.4. | |
GIT_SHA: | |
required: true | |
type: string | |
description: The git SHA you want to copy from GAR to DockerHub. For example de766ae36a1c74212d370aae75bf234320612bbc. | |
workflow_dispatch: | |
inputs: | |
processor_language: | |
required: true | |
type: choice | |
default: rust | |
options: [rust, python, typescript] | |
version_tag: | |
required: false | |
type: string | |
description: After we copy the image from GAR to DockerHub, we will add this tag to the image. For example v1.0.4. | |
GIT_SHA: | |
required: true | |
type: string | |
description: The git SHA you want to copy from GAR to DockerHub. For example de766ae36a1c74212d370aae75bf234320612bbc. | |
permissions: | |
contents: read | |
id-token: write #required for GCP Workload Identity federation | |
jobs: | |
copy-processor-images: | |
# Run on a machine with more local storage for large docker images | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # pin@v3 | |
- uses: aptos-labs/aptos-core/.github/actions/docker-setup@main | |
with: | |
GCP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} | |
GCP_SERVICE_ACCOUNT_EMAIL: ${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }} | |
- name: Login to Docker Hub | |
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b # pin@v2 | |
with: | |
username: ${{ secrets.ENV_DOCKERHUB_USERNAME }} | |
password: ${{ secrets.ENV_DOCKERHUB_PASSWORD }} | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: .node-version | |
- uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # pin https://github.com/pnpm/action-setup/releases/tag/v2.4.0 | |
with: | |
run_install: false | |
package_json_file: scripts/package.json | |
- run: pnpm install --frozen-lockfile | |
working-directory: scripts | |
- name: Release Images | |
env: | |
FORCE_COLOR: 3 # Force color output as per https://github.com/google/zx#using-github-actions | |
GIT_SHA: ${{ inputs.GIT_SHA }} | |
GCP_DOCKER_ARTIFACT_PROCESSOR_REPO_US: ${{ secrets.GCP_DOCKER_ARTIFACT_REPO_US }} | |
run: pnpm release-processor-images --language=${{ inputs.processor_language }} --version-tag=${{ inputs.version_tag }} --wait-for-image-seconds=3600 | |
working-directory: scripts |