f14288ef9e84bbf9ecd2afb847deb44c369bfda2
[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 const artifact_id = await github.rest.actions.listWorkflowRunArtifacts({
19 owner: context.repo.owner,
20 repo: context.repo.repo,
21 run_id: context.payload.workflow.run_id,
22 per_page: 1,
23 });
24 console.log(artifact_id);
25 const artifact_url = await github.rest.actions.downloadArtifact({
26 owner: context.repo.owner,
27 repo: context.repo.repo,
28 artifact_id: artifact_id.data.artifacts[0].id,
29 archive_format: "zip",
30 });
31 console.log(artifact_url);
32 return artifact_url.headers["location"];
33 - run: curl -sSLO ${{ steps.shitshow.outputs.result }}
34 - run: ls -al
35