projects
/
m6w6
/
m6w6.github.io
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Update sync_site.yml
[m6w6/m6w6.github.io]
/
.github
/
workflows
/
sync_site.yml
diff --git
a/.github/workflows/sync_site.yml
b/.github/workflows/sync_site.yml
index d2eae51b30dee19ead6e03cf109218f3a452bc9e..7f18dca85bd6167bbd97ade2941efebf0ef1b61c 100644
(file)
--- a/
.github/workflows/sync_site.yml
+++ b/
.github/workflows/sync_site.yml
@@
-1,4
+1,3
@@
-
name: sync_site
on:
name: sync_site
on:
@@
-6,31
+5,30
@@
on:
workflows: [pages-build-deployment]
types: [completed]
workflows: [pages-build-deployment]
types: [completed]
+env:
+ SYNC_SECRET: ${{ secrets.SYNC_SECRET }}
+ SYNC_COMMAND: ${{ secrets.SYNC_COMMAND }}
+
jobs:
sync:
runs-on: ubuntu-latest
steps:
jobs:
sync:
runs-on: ubuntu-latest
steps:
+ - run: umask 0077 && echo "${{ env.SYNC_SECRET }}" >/tmp/sync_secret
- uses: actions/github-script@v5
- uses: actions/github-script@v5
- id: shitshow
with:
with:
- result-encoding: string
script: |
script: |
- console.log(context);
const artifact_id = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
const artifact_id = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
- run_id: context.payload.
event.workflow.run_
id,
+ run_id: context.payload.
workflow_run.
id,
per_page: 1,
});
per_page: 1,
});
- console.log(artifact_id);
- const artifact_url = await github.rest.actions.downloadArtifact({
+ 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",
});
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
-
+ await exec.exec(process.env.SYNC_COMMAND, [], {
+ input: Buffer.from(artifact.data)
+ });