Release Images #78
Workflow file for this run
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 Images | |
on: | |
workflow_call: | |
inputs: | |
image_tag_prefix: | |
required: true | |
type: string | |
description: a prefix to use for image tags. E.g. `devnet`. It results in an image tag like `:devnet_<git_sha>` | |
GIT_SHA: | |
required: false | |
type: string | |
description: the git sha to use for the image tag. If not provided, the git sha of the triggering branch will be used | |
dry_run: | |
required: false | |
type: boolean | |
default: false | |
description: If true, run the workflow without actually pushing images | |
workflow_dispatch: | |
inputs: | |
image_tag_prefix: | |
required: true | |
type: string | |
default: adhoc | |
description: a prefix to use for image tags. E.g. `devnet`. It results in an image tag like `:devnet_<git_sha>` | |
GIT_SHA: | |
required: false | |
type: string | |
description: the git sha to use for the image tag. If not provided, the git sha of the triggering branch will be used | |
dry_run: | |
required: false | |
type: boolean | |
default: false | |
description: If true, run the workflow without actually pushing images | |
permissions: | |
contents: read | |
id-token: write #required for GCP Workload Identity federation | |
jobs: | |
copy-images: | |
# Run on a machine with more local storage for large docker images | |
runs-on: runs-on,cpu=16,family=m6id,hdd=500,image=aptos-ubuntu-x64,run-id=${{ github.run_id }} | |
steps: | |
- uses: actions/checkout@v4 | |
- 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 }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_DOCKER_ARTIFACT_REPO: ${{ secrets.AWS_DOCKER_ARTIFACT_REPO }} | |
GIT_CREDENTIALS: ${{ secrets.GIT_CREDENTIALS }} | |
- name: Login to Docker Hub | |
uses: docker/login-action@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@v4 | |
- 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 || github.sha }} # If GIT_SHA is not provided, use the sha of the triggering branch | |
AWS_ACCOUNT_ID: ${{ secrets.AWS_ECR_ACCOUNT_NUM }} | |
GCP_DOCKER_ARTIFACT_REPO: ${{ vars.GCP_DOCKER_ARTIFACT_REPO }} | |
IMAGE_TAG_PREFIX: ${{ inputs.image_tag_prefix }} | |
DRY_RUN: ${{ inputs.dry_run }} | |
run: ./docker/release-images.mjs --wait-for-image-seconds=3600 ${{ inputs.dry_run && '--dry-run' || '' }} |