X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;ds=sidebyside;f=.github%2Fworkflows%2Fsync_site.yml;h=d2eae51b30dee19ead6e03cf109218f3a452bc9e;hb=ac13fd504e5b117843294003c2cad0645959617c;hp=bef486af81828d64b7990c022cc353422db5429c;hpb=a9bfef79714e51930d5f6b391b8d276c29a2dab7;p=m6w6%2Fm6w6.github.io diff --git a/.github/workflows/sync_site.yml b/.github/workflows/sync_site.yml index bef486a..d2eae51 100644 --- a/.github/workflows/sync_site.yml +++ b/.github/workflows/sync_site.yml @@ -3,17 +3,34 @@ name: sync_site on: workflow_run: - workflows: [pages/pages-build-deployment] + workflows: [pages-build-deployment] types: [completed] jobs: sync: runs-on: ubuntu-latest steps: - - uses: dawidd6/action-download-artifact@v2 + - uses: actions/github-script@v5 + id: shitshow with: - workflow: pages-build-deployment - workflow_conclusion: success - name: github-pages - - run: tar tf artifact.tar + result-encoding: string + script: | + console.log(context); + const artifact_id = await github.rest.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: context.payload.event.workflow.run_id, + per_page: 1, + }); + console.log(artifact_id); + const artifact_url = await github.rest.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: artifact_id.data.artifacts[0].id, + archive_format: "zip", + }); + console.log(artifact_url); + return artifact_url.headers["location"]; + - run: curl -sSLO ${{ steps.shitshow.outputs.result }} + - run: ls -al