name: release on: push: branches: [master] jobs: test-and-publish: uses: ./.github/workflows/test-and-publish.yml with: environment: production secrets: inherit publish-website: runs-on: ubuntu-latest container: image: amazon/aws-cli needs: [test-and-publish] environment: 'production' steps: - name: Download docs uses: actions/download-artifact@v3 with: name: docs path: docs/ - name: Publish to S3 working-directory: docs env: AWS_CF_DISTRIBUTION_ID: ${{ secrets.AWS_CF_DISTRIBUTION_ID }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} run: | 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