Install aws cli using snap
This commit is contained in:
+21
-16
@@ -37,25 +37,30 @@ jobs:
|
|||||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
aws-region: ${{ secrets.AWS_REGION }}
|
aws-region: ${{ secrets.AWS_REGION }}
|
||||||
|
- name: Install AWS CLI
|
||||||
|
run: |
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install -y snapd
|
||||||
|
sudo snap install aws-cli --classic
|
||||||
- name: Sync hashed assets to S3
|
- name: Sync hashed assets to S3
|
||||||
uses: aws-actions/aws-cli-action@v2
|
env:
|
||||||
with:
|
BUCKET_NAME: ${{ secrets.BUCKET_NAME }}
|
||||||
command: >-
|
run: |
|
||||||
s3 sync dist/ "s3://${{ secrets.BUCKET_NAME }}"
|
aws s3 sync dist/ "s3://${BUCKET_NAME}" \
|
||||||
--delete
|
--delete \
|
||||||
--exclude "index.html"
|
--exclude "index.html" \
|
||||||
--cache-control "public, max-age=31536000, immutable"
|
--cache-control "public, max-age=31536000, immutable"
|
||||||
- name: Upload index.html
|
- name: Upload index.html
|
||||||
uses: aws-actions/aws-cli-action@v2
|
env:
|
||||||
with:
|
BUCKET_NAME: ${{ secrets.BUCKET_NAME }}
|
||||||
command: >-
|
run: |
|
||||||
s3 cp dist/index.html "s3://${{ secrets.BUCKET_NAME }}/index.html"
|
aws s3 cp dist/index.html "s3://${BUCKET_NAME}/index.html" \
|
||||||
--cache-control "no-cache, no-store, must-revalidate"
|
--cache-control "no-cache, no-store, must-revalidate" \
|
||||||
--content-type "text/html"
|
--content-type "text/html"
|
||||||
- name: Invalidate CloudFront
|
- name: Invalidate CloudFront
|
||||||
uses: aws-actions/aws-cli-action@v2
|
env:
|
||||||
with:
|
CLOUDFRONT_ID: ${{ secrets.CLOUDFRONT_ID }}
|
||||||
command: >-
|
run: |
|
||||||
cloudfront create-invalidation
|
aws cloudfront create-invalidation \
|
||||||
--distribution-id "${{ secrets.CLOUDFRONT_ID }}"
|
--distribution-id "${CLOUDFRONT_ID}" \
|
||||||
--paths "/" "/index.html"
|
--paths "/" "/index.html"
|
||||||
|
|||||||
Reference in New Issue
Block a user