mirror #1
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
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version to release' | |
required: true | |
env: | |
SOURCE_REPO: core-platform | |
ARGUS_ARTIFACTS_REPO: argus-artifacts | |
name: mirror | |
jobs: | |
mirror-artifacts: | |
runs-on: [ARM64, self-hosted, Linux] | |
steps: | |
# See https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow | |
# For why we need to generate a token and not use the default | |
- name: Generate token | |
id: generate_token | |
uses: chanzuckerberg/[email protected] | |
with: | |
app_id: ${{ secrets.CZI_RELEASE_PLEASE_APP_ID }} | |
private_key: ${{ secrets.CZI_RELEASE_PLEASE_PK }} | |
- # checkout the artifact repo | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ steps.generate_token.outputs.token }} | |
path: ${{ github.event.repository.name }} | |
- # checkout the source repo | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ steps.generate_token.outputs.token }} | |
repository: chanzuckerberg/${{ env.SOURCE_REPO}} | |
path: ${{ env.SOURCE_REPO}} | |
- # copy ci files to argus-artifacts | |
run: | | |
cp -r --parents ci/packages/*/dist/ ../${{ env.ARGUS_ARTIFACTS_REPO }}/ | |
cp -r --parents ci/packages/*/action.y*ml ../${{ env.ARGUS_ARTIFACTS_REPO }}/ | |
working-directory: ${{ env.SOURCE_REPO }} | |
- run: ls -la ./${{ env.ARGUS_ARTIFACTS_REPO }} | |
- run: ls ./${{ env.ARGUS_ARTIFACTS_REPO }}/ci/packages/create-stack/ | |
- run: ls ./${{ env.ARGUS_ARTIFACTS_REPO }}/ci/packages/create-stack/dist/ | |
- run: ls ./${{ env.ARGUS_ARTIFACTS_REPO }}/ci/packages/delete-stack/ | |
- run: ls ./${{ env.ARGUS_ARTIFACTS_REPO }}/ci/packages/delete-stack/dist/ | |
- run: ls ./${{ env.ARGUS_ARTIFACTS_REPO }}/ci/packages/shared/ | |
- run: ls ./${{ env.ARGUS_ARTIFACTS_REPO }}/ci/packages/shared/dist/ | |
- # make commit to argus artifacts | |
uses: EndBug/add-and-commit@v9 | |
id: argus_artifacts_commit | |
with: | |
add: -A | |
message: ci - mirror argus artifacts | |
cwd: ${{ env.ARGUS_ARTIFACTS_REPO }} | |
tag: '${{ inputs.version }} --force' | |
github_token: ${{ steps.generate_token.outputs.token }} |