Skip to content

Commit 7ef24a8

Browse files
committed
New static bucket
1 parent 60faf2b commit 7ef24a8

File tree

3 files changed

+45
-73
lines changed

3 files changed

+45
-73
lines changed

.github/workflows/build.yml

+45
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,51 @@ jobs:
625625
retention-days: 2
626626

627627
frontend-s3:
628+
# if: ${{ github.ref == 'refs/heads/master' && github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork && inputs.push != 'false' }}
629+
needs:
630+
- frontend
631+
- frontend-test
632+
runs-on: ubuntu-latest
633+
steps:
634+
- name: Configure AWS credentials
635+
if: ${{ github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork }}
636+
uses: aws-actions/configure-aws-credentials@v4
637+
with:
638+
aws-region: ${{ env.AWS_REGION }}
639+
role-to-assume: ${{ secrets.AWS_ROLE }}
640+
role-duration-seconds: 1200
641+
642+
- name: Login to Amazon ECR
643+
id: login-ecr
644+
uses: aws-actions/amazon-ecr-login@v2
645+
with:
646+
mask-password: 'true'
647+
648+
- name: Extract frontend files
649+
run: |
650+
rm -rf ./frontend-build/
651+
docker create -ti --name frontend_instance "${{ needs.frontend.outputs.image }}" sh
652+
docker cp frontend_instance:/static ./frontend-build
653+
docker rm -f frontend_instance
654+
655+
- name: Configure AWS credentials
656+
if: ${{ github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork }}
657+
uses: aws-actions/configure-aws-credentials@v4
658+
with:
659+
aws-region: ${{ env.AWS_REGION }}
660+
role-to-assume: ${{ secrets.AWS_ROLE }}
661+
role-duration-seconds: 1200
662+
663+
- name: Clean build from non-versioned files
664+
run: |
665+
cd ./frontend-build/
666+
for filename in index.html service-worker.js service-worker.js.map; do
667+
find . -name "$filename" -not -path "./maintenance-page/*" -type f -delete
668+
done
669+
670+
aws s3 sync --exact-timestamps . s3://evaka-static/
671+
672+
old-frontend-s3:
628673
if: ${{ github.ref == 'refs/heads/master' && github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork && inputs.push != 'false' }}
629674
needs:
630675
- frontend

bin/ci-login-cloud

-30
This file was deleted.

bin/ci-login-registry

-43
This file was deleted.

0 commit comments

Comments
 (0)