fix s3 upload

This commit is contained in:
Rodrigo Fernandes 2023-01-06 22:14:04 +00:00
parent c89192a37f
commit 7e37ce307a
2 changed files with 8 additions and 1 deletions

View file

@ -22,8 +22,9 @@ jobs:
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
name: docs name: docs
path: docs/
- name: Publish to S3 - name: Publish to S3
working-directory: docs
run: | run: |
cd docs
aws s3 sync --region eu-west-1 --delete . s3://diff2html.xyz --metadata-directive REPLACE --cache-control max-age=31557600 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 aws cloudfront create-invalidation --region eu-west-1 --distribution-id $AWS_CF_DISTRIBUTION_ID --paths /index.html /demo.html /sitemap.xml /robots.txt

View file

@ -26,6 +26,7 @@ jobs:
export NEXT_VERSION="$(/bin/git-version --folder=$PWD --release-branch=master)" export NEXT_VERSION="$(/bin/git-version --folder=$PWD --release-branch=master)"
echo "Next version is ${NEXT_VERSION}" echo "Next version is ${NEXT_VERSION}"
echo "${NEXT_VERSION}" > .version echo "${NEXT_VERSION}" > .version
echo "version=${NEXT_VERSION}" >> $GITHUB_ENV
- name: Get next npm tag name - name: Get next npm tag name
run: | run: |
if [ "${GITHUB_REF_NAME}" = "master" ]; then if [ "${GITHUB_REF_NAME}" = "master" ]; then
@ -140,6 +141,11 @@ jobs:
yarn publish --tag $(cat .tag) --non-interactive --new-version $(cat .version) yarn publish --tag $(cat .tag) --non-interactive --new-version $(cat .version)
# HACK: Restore npm package name # HACK: Restore npm package name
sed -i 's/^ "name":.*/ "name": "diff2html",/g' package.json 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 - name: Upload docs
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with: