From 92e43214239ffff1ac7c07dd82455394f41db3c0 Mon Sep 17 00:00:00 2001 From: James Mills Date: Fri, 2 Aug 2024 10:29:54 +0100 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c0e28b7..b913db5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,12 +11,12 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: '14' + node-version: '20' - name: Install dependencies run: npm install uglify-js -g @@ -24,6 +24,9 @@ jobs: - name: Minimize JavaScript run: uglifyjs script.js -o script.min.js + - name: Install AWS CLI + run: sudo apt-get install awscli -y + - name: Upload to DigitalOcean Spaces env: DO_SPACES_KEY: ${{ secrets.DO_SPACES_KEY }} @@ -31,6 +34,6 @@ jobs: SPACE_NAME: your-space-name SPACE_REGION: your-space-region run: | - curl -X PUT -T script.min.js \ - -H "Authorization: Bearer $DO_SPACES_KEY:$DO_SPACES_SECRET" \ - https://${SPACE_NAME}.${SPACE_REGION}.digitaloceanspaces.com/script.min.js + aws configure set aws_access_key_id $DO_SPACES_KEY + aws configure set aws_secret_access_key $DO_SPACES_SECRET + aws s3 cp script.min.js s3://${SPACE_NAME}/ --region ${SPACE_REGION} --endpoint https://${SPACE_REGION}.digitaloceanspaces.com