Adding CTA text customisation and updating click URL reference #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Minimize and Publish | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
- 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: cdn.reallygreatads.com | |
SPACE_REGION: sfo3 | |
run: | | |
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 --acl public-read | |
- name: Install DigitalOcean CLI | |
run: | | |
curl -sL https://github.com/digitalocean/doctl/releases/download/v1.91.0/doctl-1.91.0-linux-amd64.tar.gz | tar -xzv | |
sudo mv doctl /usr/local/bin | |
- name: Purge Cache | |
env: | |
DIGITALOCEAN_ACCESS_TOKEN: ${{ secrets.DO_ACCESS_TOKEN }} | |
run: | | |
CDN_ID=$(doctl compute cdn list --no-header --format ID) | |
doctl compute cdn flush $CDN_ID --files /script.min.js |