Merge pull request #295 from FredrikMeyer/dependabot/npm_and_yarn/vit… #766
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Build and test" | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
# The branches below must be a subset of the branches above | |
branches: [master] | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Build and test | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- run: yarn install | |
- run: yarn prettier | |
- run: yarn typecheck | |
- run: yarn lint | |
- run: yarn stylelint | |
- run: yarn build | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
role-to-assume: arn:aws:iam::069789945428:role/Homepage-GithubPublishRole7244AB40-JU1NEBBS4GP7 | |
role-session-name: github-actions-publish | |
aws-region: eu-north-1 | |
- name: Publish docs | |
if: github.ref == 'refs/heads/master' || (github.event.action == 'closed' && github.event.pull_request.merged == true) | |
run: | | |
cd dist | |
aws s3 sync . s3://homepage-cloudfrontands3s3bucketb81f9695-nq8e0380hf4g/ --delete --no-progress | |
aws cloudfront create-invalidation --distribution-id E25V7U1FD2KW5E --paths "/*" |