Update gh action for arc deploy #47
Workflow file for this run
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: Node CI | ||
# Push tests pushes; PR tests merges | ||
on: [ push, pull_request ] | ||
defaults: | ||
run: | ||
shell: bash | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: arc build | ||
uses: architect/action-build@latest | ||
with: | ||
use_lock_file: false | ||
node-version: 20 | ||
# Deploy to staging when pushing to main | ||
deploy_staging: | ||
needs: buld | ||
name: Deploy staging | ||
if: github.ref == 'refs/heads/main' && github.event_name == 'push' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: arc deploy | ||
needs: architect/action-deploy@latest | ||
with: | ||
use_lock_file: false | ||
node-version: 20 | ||
aws_access_key_id: ${{secrets.AWS_ACCESS_KEY_ID}} | ||
aws_secret_access_key: ${{secrets.AWS_SECRET_ACCESS_KEY}} | ||
- name: Image Cache Warming | ||
run: npx @enhance/image warm --directory /public/images --domain https://f4j12xutj7.execute-api.us-east-1.amazonaws.com | ||
# Deploy to production when pushing with a version tag | ||
deploy_production: | ||
needs: build | ||
name: Deploy production | ||
if: startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: arc deploy | ||
needs: architect/action-deploy@latest | ||
with: | ||
use_lock_file: false | ||
node-version: 20 | ||
aws_access_key_id: ${{secrets.AWS_ACCESS_KEY_ID}} | ||
aws_secret_access_key: ${{secrets.AWS_SECRET_ACCESS_KEY}} | ||
- name: Image Cache Warming | ||
run: npx @enhance/image warm --directory /public/images --domain https://colepeters.com | ||