Update sync_site.yml
[m6w6/m6w6.github.io] / .github / workflows / sync_site.yml
1
2 name: sync_site
3
4 on:
5 workflow_run:
6 workflows: [pages-build-deployment]
7 types: [completed]
8
9 jobs:
10 sync:
11 runs-on: ubuntu-latest
12 steps:
13 - uses: actions/github-script@v5
14 id: shitshow
15 with:
16 result-encoding: string
17 script: |
18 console.log(context);
19 const artifact_id = await github.rest.actions.listWorkflowRunArtifacts({
20 owner: context.repo.owner,
21 repo: context.repo.repo,
22 run_id: context.payload.workflow_run.id,
23 per_page: 1,
24 });
25 console.log(artifact_id);
26 const artifact_url = await github.rest.actions.downloadArtifact({
27 owner: context.repo.owner,
28 repo: context.repo.repo,
29 artifact_id: artifact_id.data.artifacts[0].id,
30 archive_format: "zip",
31 });
32 console.log(artifact_url);
33 return artifact_url.headers["location"];
34 - run: curl -sSLO ${{ steps.shitshow.outputs.result }}
35 - run: ls -al
36