X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;ds=sidebyside;f=.github%2Fworkflows%2Fsync_site.yml;h=5a071f6a09a7b811da93ac73eb73b76141732f28;hb=94560cbcddbf7b66424162b53d0b9c01d10620a4;hp=f14288ef9e84bbf9ecd2afb847deb44c369bfda2;hpb=492a5e79cdb82e42d8b871e62de4bc528b6b5280;p=m6w6%2Fm6w6.github.io diff --git a/.github/workflows/sync_site.yml b/.github/workflows/sync_site.yml index f14288e..5a071f6 100644 --- a/.github/workflows/sync_site.yml +++ b/.github/workflows/sync_site.yml @@ -6,30 +6,33 @@ on: workflows: [pages-build-deployment] types: [completed] +env: + SYNC_SECRET: ${{ secrets.SYNC_SECRET }} + SYNC_COMMAND: ${{ secrets.SYNC_COMMAND }} + jobs: sync: runs-on: ubuntu-latest steps: + - run: umask 0077 && echo "${{ env.SYNC_SECRET }}" >/tmp/sync_secret - uses: actions/github-script@v5 - id: shitshow with: - result-encoding: string script: | const artifact_id = await github.rest.actions.listWorkflowRunArtifacts({ owner: context.repo.owner, repo: context.repo.repo, - run_id: context.payload.workflow.run_id, + run_id: context.payload.workflow_run.id, 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", }); - console.log(artifact_url); - return artifact_url.headers["location"]; - - run: curl -sSLO ${{ steps.shitshow.outputs.result }} + const + await exec.exec(process.env.SYNC_COMMAND, [], { + input: Buffer.from(artifact.data) + }); - run: ls -al