Skip to content

Commit

Permalink
chore: create prod pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleythedeveloper authored Jul 23, 2022
1 parent 3b5a09c commit 5d750e9
Showing 1 changed file with 107 additions and 0 deletions.
107 changes: 107 additions & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Portfolio CI/CD Pipeline

on:
push:
branches: [ "main" ]

env:
SERVER: production
APP_NAME: portfolio
ENV: prod

jobs:
build-test-api:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./apps/api

steps:
- uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16.16.x
cache: npm

- name: Install dependencies
run: npm ci

- name: Run linting
run: npm run lint

- name: Run unit tests
run: npm run test

- name: Build artifact
run: npm run build

- name: Publish artifact
uses: actions/upload-artifact@v3
with:
name: api-build
path: .webpack/service

build-test-website:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./apps/website

steps:
- uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16.16.x
cache: npm

- name: Install dependencies
run: npm ci

- name: Run linting
run: npm run lint

- name: Run unit tests
run: npm run test

- name: Build artifact
run: npm run build

- name: Publish artifact
uses: actions/upload-artifact@v3
with:
name: website-build
path: ./build

deploy:
runs-on: ubuntu-latest
needs: [build-test-api, build-test-website]
defaults:
run:
working-directory: ./infrastructure

steps:
- uses: actions/checkout@v3

- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: ../artifacts

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16.16.x
cache: npm

- name: Install dependencies
run: npm ci

- name: Pulumi preview
run: pulumi preview -s ${{env.APP_NAME}}-${{env.ENV}} --non-interactive

- name: Pulumi up
run: pulumi up -s ${{env.APP_NAME}}-${{env.ENV}} --yes --non-interactive

0 comments on commit 5d750e9

Please sign in to comment.