X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fm6w6.github.io;a=blobdiff_plain;f=.github%2Fworkflows%2Fsync_site.yml;h=8a5100630eac46821af3a9eb843fd0cd9dfb3065;hp=bef486af81828d64b7990c022cc353422db5429c;hb=48eadf26d01ad06f644a04edb77ebe26559798c0;hpb=a9bfef79714e51930d5f6b391b8d276c29a2dab7 diff --git a/.github/workflows/sync_site.yml b/.github/workflows/sync_site.yml index bef486a..8a51006 100644 --- a/.github/workflows/sync_site.yml +++ b/.github/workflows/sync_site.yml @@ -3,17 +3,30 @@ 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 with: - workflow: pages-build-deployment - workflow_conclusion: success - name: github-pages - - run: tar tf artifact.tar + script: | + const artifact_id = await github.rest.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: context.payload.workflow_run.id, + per_page: 1, + }); + const artifact = await github.rest.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: artifact_id.data.artifacts[0].id, + archive_format: "zip", + }); + await exec.exec("tar xz", [], { + input: artifact.data + }); + - run: ls -al