Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Commit

Permalink
add pipeline (#3)
Browse files Browse the repository at this point in the history

---------

Co-authored-by: diana esteves <[email protected]>
  • Loading branch information
desteves and diana esteves authored Aug 5, 2024
1 parent 374270c commit e84194c
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: branch

on:
pull_request:
branches: [ "main" ]
workflow_dispatch:

permissions:
contents: read
pull-requests: write
id-token: write

jobs:
pulumi-preview:
name: pulumi-preview
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4

# Best practice: use a short-lived to auth to Pulumi Cloud
# The OIDC Issuer must be properly configured in the Pulumi Organization
# For more information, see
# https://www.pulumi.com/docs/pulumi-cloud/oidc/client/github/
- name: setup short-lived token
uses: pulumi/auth-actions@v1
with:
organization: pulumi-sandbox-diana
requested-token-type: urn:pulumi:token-type:access_token:organization

- name: set up node
uses: actions/setup-node@v4
with:
node-version: 20

- name: install app deps
working-directory: ./app
run: npm install
# TODO -- need to build?

- name: install infra deps
working-directory: ./infra
run: npm install

- name: preview resources
uses: pulumi/actions@v5
with:
command: preview
stack-name: pulumi-sandbox-diana/cloudflare-workers-ai/prod
work-dir: ./infra
comment-on-pr: true
comment-on-summary: true
edit-pr-comment: true
54 changes: 54 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: main

on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: read
pull-requests: write
id-token: write

jobs:
pulumi-up:
name: pulumi-up
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4

# Best practice: use a short-lived to auth to Pulumi Cloud
# The OIDC Issuer must be properly configured in the Pulumi Organization
# For more information, see
# https://www.pulumi.com/docs/pulumi-cloud/oidc/client/github/
- name: setup short-lived token
uses: pulumi/auth-actions@v1
with:
organization: pulumi-sandbox-diana
requested-token-type: urn:pulumi:token-type:access_token:organization

- name: set up node
uses: actions/setup-node@v4
with:
node-version: 20

- name: install app deps
working-directory: ./app
run: npm install
# TODO -- need to build?

- name: install infra deps
working-directory: ./infra
run: npm install

- name: upsert resources
uses: pulumi/actions@v5
with:
command: up
stack-name: pulumi-sandbox-diana/cloudflare-workers-ai/prod
work-dir: ./infra
comment-on-pr: true
comment-on-summary: true
edit-pr-comment: true

0 comments on commit e84194c

Please sign in to comment.