Merge pull request #66 from Aidan-Chey/dependabot/npm_and_yarn/multi-… #60
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: New Sentry Release And deploy to Firebase | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.7 | |
- name: Use Node 20.x | |
uses: actions/setup-node@v4.0.3 | |
with: | |
node-version: '20.x' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build:prod | |
- name: Archive build artifacts | |
uses: actions/upload-artifact@v4.4.0 | |
with: | |
name: dist | |
path: dist | |
retention-days: 2 | |
release: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
# See: https://help.github.com/en/actions/automating-your-workflow-with-github-actions/configuring-a-workflow#using-the-checkout-action | |
- name: Checkout | |
uses: actions/checkout@v4.1.7 | |
- name: Download build artifacts | |
uses: actions/download-artifact@v4.1.8 | |
with: | |
name: dist | |
path: dist | |
- name: Create Sentry release | |
uses: getsentry/action-release@v1.7.0 | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
SENTRY_ORG: ${{ secrets.SENTRY_ORG }} | |
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} | |
with: | |
environment: firebase | |
sourcemaps: dist/grocerment | |
deploy: | |
runs-on: ubuntu-latest | |
needs: [build, release] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.7 | |
- name: Download build artifacts | |
uses: actions/download-artifact@v4.1.8 | |
with: | |
name: dist | |
path: dist | |
- name: Deploy to Firebase | |
uses: w9jds/firebase-action@master | |
with: | |
args: deploy --only hosting | |
env: | |
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} | |