Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmills authored Aug 2, 2024
1 parent 094f2f1 commit 92e4321
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,29 @@ 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

- 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 }}
DO_SPACES_SECRET: ${{ secrets.DO_SPACES_SECRET }}
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

0 comments on commit 92e4321

Please sign in to comment.