-
Notifications
You must be signed in to change notification settings - Fork 82
83 lines (72 loc) · 3.01 KB
/
copy-processor-images-to-dockerhub.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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@fe02b34f77f8bc703788d5817da081398fad5dd2 # pin https://github.com/pnpm/action-setup/releases/tag/v4.0.0
with:
run_install: false
package_json_file: scripts/package.json
- run: pnpm install --frozen-lockfile
working-directory: scripts
- name: Install Dependencies and Run Linter
uses: ./.github/actions/dep_install_and_lint
with:
working-directory: rust
- name: Run Integration Tests for Specific Crate
run: cargo test --manifest-path integration-tests/Cargo.toml
working-directory: rust
- 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_REPO: ${{ vars.GCP_DOCKER_ARTIFACT_REPO }}
run: pnpm release-processor-images --language=${{ inputs.processor_language }} --version-tag=${{ inputs.version_tag }} --wait-for-image-seconds=3600
working-directory: scripts