Merge pull request #30 from wilburx9/develop #19
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 the Ghost theme | |
on: | |
push: | |
branches: | |
- 'live' | |
paths: | |
- 'frontend/**' | |
jobs: | |
deploy-frontend: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
working-directory: frontend | |
run: yarn install | |
- name: Generate CSS & JS | |
working-directory: frontend | |
run: yarn pretest | |
- name: Package the theme into a zip file | |
working-directory: frontend | |
run: yarn zip | |
- name: Deploy and activate the theme | |
working-directory: frontend | |
env: | |
GHOST_API_URL: ${{ secrets.GHOST_ADMIN_API_URL }} | |
GHOST_API_KEY: ${{ secrets.GHOST_ADMIN_API_KEY }} | |
run: yarn deploy | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Clear Lightsail Distribution Cache | |
run: | | |
aws lightsail reset-distribution-cache --distribution-name ${{ secrets.LIGHTSAIL_DISTRIBUTION }} | |