Skip to content

Commit

Permalink
refactor: use packages and improved drift checking (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
simenandre authored Jul 14, 2023
1 parent e085757 commit 37debbd
Show file tree
Hide file tree
Showing 24 changed files with 1,734 additions and 1,616 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/drift-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Drift check
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

jobs:
check-for-changes:
Expand All @@ -11,21 +12,37 @@ jobs:
- name: Checkout 🛎️
uses: actions/checkout@v3

- name: Setup Node LTS ✨
uses: actions/setup-nodejs@v3
- uses: pnpm/action-setup@v2

- name: Use Node LTS ✨
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: yarn
cache: pnpm

- name: Installing dependencies 📦️
run: yarn install
- name: Install dependencies 📦️
run: pnpm install --frozen-lockfile

- name: Applying infrastructure 🚀
uses: pulumi/actions@v4
id: pulumi
env:
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
with:
command: preview
refresh: true
stack-name: bjerk/prod
expect-no-changes: true

- uses: slackapi/[email protected]
# if: failure()
with:
payload: |
{
"repositoryUrl": "bjerkio/bot",
"jobUrl": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"message": "Issues detected",
"details": "${{ steps.pulumi.outputs.output }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
33 changes: 33 additions & 0 deletions .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Pull Request
on:
pull_request:

jobs:
preview-changes:
name: Preview changes
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3

- uses: pnpm/action-setup@v2

- name: Use Node LTS ✨
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: pnpm

- name: Install dependencies 📦️
run: pnpm install --frozen-lockfile

- name: Run Pulumi 🚀
uses: pulumi/actions@v4
env:
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
with:
command: preview
refresh: true
stack-name: bjerk/prod
comment-on-pr: true
github-token: ${{ secrets.BJERKBOT_GITHUB_TOKEN }}
48 changes: 48 additions & 0 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Push
on:
push:
branches:
- main

jobs:
apply-changes:
name: Apply changes
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3

- uses: pnpm/action-setup@v2

- name: Use Node LTS ✨
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: pnpm

- name: Install dependencies 📦️
run: pnpm install --frozen-lockfile

- name: Run Pulumi 🚀
uses: pulumi/actions@v4
env:
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
with:
command: up
refresh: true
stack-name: bjerk/prod

todo-to-issue:
name: Create issue from TODO comments
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3

- name: Create issue from TODO comments 📝
uses: derjuulsn/todo-issue@main
with:
excludePattern: '^(node_modules/)'
label: needs-refinement
env:
GITHUB_TOKEN: ${{ secrets.BJERKIO_GITHUB_TOKEN }}
35 changes: 0 additions & 35 deletions .github/workflows/pull-request.yml

This file was deleted.

50 changes: 0 additions & 50 deletions .github/workflows/push.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,4 @@ dist

# TernJS port file
.tern-port
stack*.json
16 changes: 8 additions & 8 deletions Pulumi.prod.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
config:
bjerk-bot:bjerkbot-github-token:
secure: AAABAA9O48OAPfAGncxn53I4/Xi3byjISs4i7D1AEm2cFZm5FmTDZjKJPRplea7T1+i0/DPk9lcM15Q9D0ttK1TvZXcmia8x
bjerk-bot:repositories-with-github-token:
- repo: taksnor/infra
- repo: taksnor/workflows
bjerkio:org-wide-npm-expires-at: '2023-07-08'
bjerkio:org-wide-npm-token:
secure: AAABAKDA8LFLyp9CS4iTUfo/FJDd+DPtpG/+u4xKuA92TVr6L13Jp4Au1k/JJ/VQebb25H38/w2BDxZxf9qeNS2ZP9d5blku
github:token:
secure: AAABACBlKdGm/kuUYSToDvxLoNJu93dZp6qFZeN10MGie3zo+CxFENxQpvpLsW0an2Y6wOP29wfBPYm4fEIGAbtsBpb8DAZc
github:token-expires-at: "2023-10-12T17:02:28.080Z"
github:token-id:
secure: AAABAGHYP1tlpnfEAZ8wZCtKTdtXQ7UexENZikcrOp3gGMKWa4+Kc3U=
npm:token:
secure: AAABANec3OTPD09nX1IICGMNdmglSEqjPt5ZHq3MOi9NNB5FUCMl+x205L1FafLyjQqB4fisiWbhNpKjm8d0lDoKrIVmrwbw
npm:token-expires-at: "2023-10-12T17:03:05.892Z"
19 changes: 0 additions & 19 deletions config.ts

This file was deleted.

6 changes: 0 additions & 6 deletions github/bjerkorg/config.ts

This file was deleted.

15 changes: 0 additions & 15 deletions github/bjerkorg/org-wide-github-token.ts

This file was deleted.

27 changes: 0 additions & 27 deletions github/bjerkorg/org-wide-npm-token.ts

This file was deleted.

7 changes: 0 additions & 7 deletions github/bjerkorg/provider.ts

This file was deleted.

25 changes: 0 additions & 25 deletions github/dynamic-github-providers.ts

This file was deleted.

7 changes: 0 additions & 7 deletions github/getbranches/provider.ts

This file was deleted.

34 changes: 0 additions & 34 deletions github/repositories-with-github-tokens.ts

This file was deleted.

Loading

0 comments on commit 37debbd

Please sign in to comment.