From 7e37ce307af91ef167ddae4a6894f70dc84408ad Mon Sep 17 00:00:00 2001 From: Rodrigo Fernandes Date: Fri, 6 Jan 2023 22:14:04 +0000 Subject: [PATCH] fix s3 upload --- .github/workflows/release.yml | 3 ++- .github/workflows/test-and-publish.yml | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2e66f64a..4ba0b40b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,8 +22,9 @@ jobs: uses: actions/download-artifact@v3 with: name: docs + path: docs/ - name: Publish to S3 + working-directory: docs run: | - cd docs aws s3 sync --region eu-west-1 --delete . s3://diff2html.xyz --metadata-directive REPLACE --cache-control max-age=31557600 aws cloudfront create-invalidation --region eu-west-1 --distribution-id $AWS_CF_DISTRIBUTION_ID --paths /index.html /demo.html /sitemap.xml /robots.txt diff --git a/.github/workflows/test-and-publish.yml b/.github/workflows/test-and-publish.yml index e37ec332..464c45d5 100644 --- a/.github/workflows/test-and-publish.yml +++ b/.github/workflows/test-and-publish.yml @@ -26,6 +26,7 @@ jobs: export NEXT_VERSION="$(/bin/git-version --folder=$PWD --release-branch=master)" echo "Next version is ${NEXT_VERSION}" echo "${NEXT_VERSION}" > .version + echo "version=${NEXT_VERSION}" >> $GITHUB_ENV - name: Get next npm tag name run: | if [ "${GITHUB_REF_NAME}" = "master" ]; then @@ -140,6 +141,11 @@ jobs: yarn publish --tag $(cat .tag) --non-interactive --new-version $(cat .version) # HACK: Restore npm package name sed -i 's/^ "name":.*/ "name": "diff2html",/g' package.json + - name: Tag commit + uses: tvdias/github-tagger@v0.0.1 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + tag: "${{ env.version }}" - name: Upload docs uses: actions/upload-artifact@v3 with: