From 6cf33892414da251ec0c29101419083ecbb04964 Mon Sep 17 00:00:00 2001 From: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Date: Mon, 22 Jul 2024 09:24:13 -0500 Subject: [PATCH] Add publish from branch workflow (#4664) --- .github/workflows/publish-branch.yml | 44 +++++++++++++++++++++++++++ .github/workflows/publish-release.yml | 4 +-- 2 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/publish-branch.yml diff --git a/.github/workflows/publish-branch.yml b/.github/workflows/publish-branch.yml new file mode 100644 index 00000000000..1ee8ee22bea --- /dev/null +++ b/.github/workflows/publish-branch.yml @@ -0,0 +1,44 @@ +name: hdf5 publish files in HDF5 folder from branch to S3 + +# Triggers the workflow on demand +on: + workflow_dispatch: + inputs: + local_dir: + description: 'HDF5 local directory' + type: string + required: true + target_dir: + description: 'hdf5 target bucket directory' + type: string + required: true + permissions: + contents: read + +jobs: + publish-tag: + runs-on: ubuntu-latest + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Get Sources + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + with: + fetch-depth: 0 + ref: '${{ github.head_ref || github.ref_name }}' + + - name: List files for the space + run: | + ls -l ${{ github.workspace }} + ls ${{ github.workspace }}/HDF5 + + - name: Setup AWS CLI + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Sync dir to S3 bucket + run: | + aws s3 sync ./HDF5/${{ inputs.local_dir }} s3://${{ secrets.AWS_S3_BUCKET }}/${{ vars.TARGET_PATH }}/${{ inputs.target_dir }} + diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 57922e80c5e..d7c7fd091d1 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -47,9 +47,9 @@ jobs: aws s3 sync ./HDF5 s3://${{ secrets.AWS_S3_BUCKET }}/${{ vars.TARGET_PATH }}/${{ inputs.target_dir }}/downloads --delete - name: Uncompress source (Linux) - run: tar -zxvf ${{ github.workspace }}/${{ inputs.use_hdf }}.doxygen.tar.gz + run: tar -zxvf ${{ github.workspace }}/HDF5/${{ inputs.use_hdf }}.doxygen.tar.gz - name: Sync userguide to S3 bucket run: | - aws s3 sync ./doxygen s3://${{ secrets.AWS_S3_BUCKET }}/${{ vars.TARGET_PATH }}/${{ inputs.target_dir }}/documentation --delete + aws s3 sync ./HDF5/doxygen s3://${{ secrets.AWS_S3_BUCKET }}/${{ vars.TARGET_PATH }}/${{ inputs.target_dir }}/documentation/doxygen --delete