diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 9005225..f8127af 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -1,4 +1,4 @@ -name: Build and release +name: Build & Deploy permissions: contents: read @@ -17,12 +17,7 @@ on: jobs: build: runs-on: ubuntu-latest - environment: - name: "Production" - url: ${{ vars.PUBLIC_URL }} - env: - S3_BUCKET: ${{ vars.S3_BUCKET }} - CF_DISTRIBUTION_ID: ${{ vars.CF_DISTRIBUTION_ID }} + steps: - name: Checkout uses: actions/checkout@v4 @@ -33,7 +28,32 @@ jobs: - name: Build project run: yarn build - - name: configure aws credentials + - 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: + - uses: actions/download-artifact@v4 + with: + name: build + + - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 with: aws-region: us-east-1