Skip to content

Pulumi

Pulumi #38

Workflow file for this run

name: Pulumi
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
pulumi:
runs-on: ubuntu-latest
env:
PULUMI_CONFIG_PASSPHRASE: ${{ secrets.PULUMI_CONFIG_PASSPHRASE }}
steps:
- name: Checkout πŸ›Ž
uses: actions/checkout@master
with:
fetch-depth: 1
- name: Setup node πŸ—
uses: actions/setup-node@v3
with:
node-version: 16
- name: Setup pnpm πŸ“¦
id: pnpm-install
uses: pnpm/[email protected]
with:
version: 7
run_install: false
- name: Get pnpm store directory πŸ“
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- name: Setup pnpm cache πŸ“¦
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-install.outputs.dest }}
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Obtain a GitHub App Installation Access Token
id: githubAppAuth
run: |
TOKEN="$(npx obtain-github-app-installation-access-token ci ${{ secrets.GH_APP_CREDENTIALS_TOKEN }})"
echo "::add-mask::$TOKEN"
echo "::set-output name=token::$TOKEN"
- uses: actions/checkout@v3
with:
repository: "CunnyDev/stack"
token: ${{ steps.githubAppAuth.outputs.token }}
path: stack
- run: pnpm install
- run: curl -fsSL https://get.pulumi.com | sh
- run: ~/.pulumi/bin/pulumi login --local
- run: ~/.pulumi/bin/pulumi stack init cunnydev
- run: ~/.pulumi/bin/pulumi stack select cunnydev
- run: ~/.pulumi/bin/pulumi stack import --file=stack/stack.json
- run: ~/.pulumi/bin/pulumi preview
- run: ~/.pulumi/bin/pulumi up --yes
env:
GITHUB_TOKEN: ${{ steps.githubAppAuth.outputs.token }}
if: github.ref == 'refs/heads/main'
- run: ~/.pulumi/bin/pulumi stack export --file=stack/stack.json
if: github.ref == 'refs/heads/main'
- run: cat stack/stack.json
if: github.ref == 'refs/heads/main'
- run: ./sync.sh
if: github.ref == 'refs/heads/main'