Merge pull request #110 from scpwiki/dependabot/npm_and_yarn/braces-3… #72
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: Deploy | |
on: | |
push: | |
branches: | |
- main | |
env: | |
BUCKET_PATH: theme/en/sigma | |
jobs: | |
build-and-deploy: | |
name: Deploy CSS | |
runs-on: ubuntu-latest | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Install dependencies | |
run: npm ci | |
- name: Install doctl | |
uses: digitalocean/action-doctl@v2 | |
with: | |
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} | |
- name: Build | |
run: ./build.sh | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: dist/ | |
- name: Deploy (GitHub Pages) | |
uses: actions/deploy-pages@v4 | |
id: deployment | |
- name: Upload to S3 | |
run: | | |
export sync_args=( "--delete" "--acl" "public-read" "dist" "s3://${{ vars.AWS_S3_BUCKET }}/${{ env.BUCKET_PATH }}" ) | |
# Manually set content-types for anything aws-cli can't guess correctly | |
aws s3 sync ${sync_args[@]} --exclude "*" --include "*.css" --content-type "text/css; charset=utf-8" | |
aws s3 sync ${sync_args[@]} --exclude "*.css" | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_ENDPOINT_URL: 'https://${{ vars.DIGITALOCEAN_SPACES_REGION }}.digitaloceanspaces.com' | |
AWS_DEFAULT_REGION: 'us-east-1' | |
- name: Invalidate Spaces Cache | |
run: doctl compute cdn flush $DIGITALOCEAN_CDN_ID | |
env: | |
DIGITALOCEAN_CDN_ID: ${{ vars.DIGITALOCEAN_CDN_ID }} |