@@ -625,6 +625,51 @@ jobs:
625
625
retention-days : 2
626
626
627
627
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 :
628
673
if : ${{ github.ref == 'refs/heads/master' && github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork && inputs.push != 'false' }}
629
674
needs :
630
675
- frontend
0 commit comments