diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 8e8eaae7996..12989766afc 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -82,23 +82,18 @@ jobs: env: GH_TOKEN: ${{ github.token }} - - name: Pull baseline image data from dvc remote - id: dvc-pull + - name: Download DVC cache from GitHub Artifacts continue-on-error: true - run: | - dvc remote modify origin url https://${DAGSHUB_TOKEN}@dagshub.com/GenericMappingTools/gmt.dvc --local - dvc pull --remote origin --no-run-cache --force + run: gh run download -n dvc-cache -D .dvc/cache/ env: - DAGSHUB_TOKEN: ${{ secrets.DAGSHUB_TOKEN }} + GH_TOKEN: ${{ github.token }} - - name: Download DVC cache from GitHub Artifacts and restore baseline image data - if: steps.dvc-pull.outcome == 'failure' + - name: Pull missing baseline image data from dvc remote run: | - rm -rf .dvc/cache/ - gh run download -n dvc-cache -D .dvc/cache/ - dvc checkout --force + dvc remote modify origin url https://${DAGSHUB_TOKEN}@dagshub.com/GenericMappingTools/gmt.dvc --local + dvc pull --remote origin --no-run-cache --force || dvc checkout --force env: - GH_TOKEN: ${{ github.token }} + DAGSHUB_TOKEN: ${{ secrets.DAGSHUB_TOKEN }} - name: Configure GMT run: bash ci/config-gmt.sh diff --git a/.github/workflows/dvc-diff.yml b/.github/workflows/dvc-diff.yml index 021f7bcc5f5..0634d9509c4 100644 --- a/.github/workflows/dvc-diff.yml +++ b/.github/workflows/dvc-diff.yml @@ -15,6 +15,7 @@ on: - '**/*.dvc' permissions: + actions: read contents: read pull-requests: write @@ -33,22 +34,18 @@ jobs: - name: Setup data version control (DVC) uses: iterative/setup-dvc@v2 - - name: Pull baseline image data from dvc remote - id: dvc-pull + - name: Download DVC cache from GitHub Artifacts continue-on-error: true + run: gh run download -n dvc-cache -D .dvc/cache/ + env: + GH_TOKEN: ${{ github.token }} + + - name: Pull missing baseline image data from dvc remote env: DAGSHUB_TOKEN: ${{ secrets.DAGSHUB_TOKEN }} run: | dvc remote modify origin url https://${DAGSHUB_TOKEN}@dagshub.com/GenericMappingTools/gmt.dvc --local - dvc pull --remote origin --no-run-cache || dvc pull --remote origin --no-run-cache - - - name: Download DVC cache from GitHub Artifacts and restore baseline image data - if: steps.dvc-pull.outcome == 'failure' - run: | - gh run download -n dvc-cache -D .dvc/cache/ - dvc checkout --force - env: - GH_TOKEN: ${{ github.token }} + dvc pull --remote origin --no-run-cache || dvc pull --remote origin --no-run-cache || dvc checkout --force - name: Setup continuous machine learning (CML) uses: iterative/setup-cml@v3