Skip to content

[stale] (Copilot Workspace) Implement Terraform #280

[stale] (Copilot Workspace) Implement Terraform

[stale] (Copilot Workspace) Implement Terraform #280

Workflow file for this run

name: "CI/CD"
on:
push:
branches:
- main
pull_request:
branches: [ main ]
jobs:
# lint:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# node-version: [20]
# steps:
# - uses: actions/checkout@v3
# - uses: pnpm/action-setup@v4
# with:
# version: 8
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v4
# with:
# node-version: ${{ matrix.node-version }}
# cache: 'pnpm'
# - name: Install dependencies
# run: pnpm install
# - run: pnpm run lint
deploy:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
node-version: [22]
# needs: [lint]
environment:
name: 'production'
url: 'https://discord.worker.nceahelp.com/'
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Trigger Terraform Workflow
uses: actions/github-script@v6
with:
script: |
const { execSync } = require('child_process');
execSync('terraform init', { stdio: 'inherit' });
execSync('terraform apply -auto-approve', { stdio: 'inherit' });
- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
# SENTRY_URL: https://sentry.io/
with:
environment: production