Upload-Artifacts #40
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: Upload-Artifacts | |
on: | |
workflow_run: | |
workflows: [Blockifier-CI-Test] | |
types: [completed] | |
jobs: | |
on-success: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
steps: | |
- name: Commit hash - 1 | |
# if: ${{ github.event_name == 'pull_request' }} | |
env: | |
COMMIT_SHA: ${{ github.event.workflow_run.head_commit.id }} | |
run: | | |
echo "SHORT_HASH=${COMMIT_SHA:0:7}" >> $GITHUB_ENV | |
echo "COMMIT_SHA=${COMMIT_SHA}" >> $GITHUB_ENV | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ env.COMMIT_SHA }} | |
- name: Verify current branch | |
run: git branch --show-current | |
- name: the workflow run URL | |
run: | | |
echo "The workflow run URL is: $GITHUB_RUN_URL" | |
- name: Get PR Number | |
# if: github.event.workflow_run.pull_requests != '' | |
run: | | |
if [[ "${{ toJson(github.event.workflow_run.pull_requests) }}" != "[]" ]]; then | |
pr_number=$(echo "${{ toJson(github.event.workflow_run.pull_requests) }}" | jq -r '.[0].number') | |
echo "PR number is $pr_number" | |
echo "PR_NUMBER=$pr_number" >> $GITHUB_ENV | |
else | |
echo "No pull request found" | |
echo "PR_NUMBER=" >> $GITHUB_ENV | |
fi | |
- name: Authenticate with GCS | |
uses: "google-github-actions/auth@v2" | |
with: | |
credentials_json: ${{ secrets.NADIN_TEST_FORK_BUCKET_ACCESS_KEY }} | |
- name: ls | |
run: ls | |
- name: Upload binary to GCP | |
id: upload_file | |
uses: "google-github-actions/upload-cloud-storage@v2" | |
with: | |
path: "upload_to_gcp.txt" | |
destination: "nadin-test-fork/${{ env.SHORT_HASH }}/" | |
on-failure: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'failure' }} | |
steps: | |
- run: echo 'The triggering workflow failed' |