Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
freva committed Oct 16, 2024
1 parent cf84c37 commit 13fb6ab
Showing 1 changed file with 24 additions and 32 deletions.
56 changes: 24 additions & 32 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,42 +17,34 @@ on:
jobs:
build:
runs-on: ubuntu-latest
#
# steps:
# - name: Checkout
# uses: actions/checkout@v4
#
# - name: Install dependencies
# run: yarn install
#
# - name: Build project
# run: yarn build
#
# - name: Store build artifact
# uses: actions/upload-artifact@v4
# with:
# name: build
# path: dist/
#
# deploy:
# runs-on: ubuntu-latest
#
# needs:
# - build

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: yarn install

- name: Build project
run: yarn build

- name: Store build artifact
uses: actions/upload-artifact@v4
with:
name: build
path: dist/

deploy:
runs-on: ubuntu-latest

needs:
- build

environment:
name: Production
url: ${{ vars.PUBLIC_URL }}

env:
S3_BUCKET: ${{ vars.S3_BUCKET }}
CF_DISTRIBUTION_ID: ${{ vars.CF_DISTRIBUTION_ID }}

steps:
- name: Debug
run: |
echo '${{ toJSON(vars) }}'
- uses: actions/download-artifact@v4
with:
name: build
Expand All @@ -66,5 +58,5 @@ jobs:

- name: Deploy
run: |
aws s3 sync dist/ "s3://${S3_BUCKET}/frontend/" --exclude "*.map" --no-progress
aws cloudfront create-invalidation --distribution-id "${CF_DISTRIBUTION_ID}" --paths "/*"
aws s3 sync dist/ "s3://${{ vars.S3_BUCKET }}/frontend/" --exclude "*.map" --no-progress
aws cloudfront create-invalidation --distribution-id "${{ vars.CF_DISTRIBUTION_ID }}" --paths "/*"

0 comments on commit 13fb6ab

Please sign in to comment.