-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from GrantBirki/init
Init
- Loading branch information
Showing
9 changed files
with
228 additions
and
0 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @GrantBirki |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
### 👋 Thanks for opening a pull request! | ||
|
||
Here is a trimmed down summary of the deployment process: | ||
|
||
1. 🧪 Run a noop deployment with `.noop` as a comment on this PR | ||
1. 👀 Observe the CI and `noop` output on this pull request to ensure it is passing and doing what it is supposed to do | ||
1. ✔️ Obtain an approval/review on this pull request | ||
1. 🚀 Branch deploy your pull request to production with `.deploy` | ||
|
||
> If anything goes wrong, rollback with `.deploy main` | ||
1. 🎉 Merge! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
deployment-check: | ||
runs-on: ubuntu-latest | ||
outputs: # set outputs for use in downstream jobs | ||
continue: ${{ steps.deployment-check.outputs.continue }} | ||
|
||
steps: | ||
# https://github.com/github/branch-deploy/blob/d3c24bd92505e623615b75ffdfac5ed5259adbdb/docs/merge-commit-strategy.md | ||
- name: deployment check | ||
uses: github/branch-deploy@v9 | ||
id: deployment-check | ||
with: | ||
merge_deploy_mode: "true" | ||
environment: production | ||
|
||
deploy: | ||
if: ${{ needs.deployment-check.outputs.continue == 'true' && github.event_name == 'push' }} | ||
needs: deployment-check | ||
environment: production | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
cache: 'pip' | ||
|
||
- name: install requirements | ||
run: pip install -r requirements.txt | ||
|
||
- uses: grantbirki/octodns-action@v1 | ||
id: octodns | ||
with: | ||
config_path: production.yaml | ||
doit: '--doit' | ||
env: | ||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: json-yaml-validate | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write # enable write permissions for pull request comments | ||
|
||
jobs: | ||
json-yaml-validate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: json-yaml-validate | ||
id: json-yaml-validate | ||
uses: GrantBirki/json-yaml-validate@v2 | ||
with: | ||
comment: "true" # enable comment mode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: new pull request | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
pull-requests: write | ||
contents: read | ||
|
||
jobs: | ||
new-pr: | ||
if: github.event_name == 'pull_request' && github.event.action == 'opened' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Comment on new PR requests with deployment instructions | ||
- uses: actions/checkout@v4 | ||
- name: comment | ||
uses: GrantBirki/comment@v2 | ||
continue-on-error: true | ||
with: | ||
file: .github/new-pr-comment.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Unlock On Merge | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
unlock-on-merge: | ||
runs-on: ubuntu-latest | ||
if: github.event.pull_request.merged == true | ||
|
||
steps: | ||
- name: unlock on merge | ||
uses: github/branch-deploy@v9 | ||
id: unlock-on-merge | ||
with: | ||
unlock_on_merge_mode: "true" # <-- indicates that this is the "Unlock on Merge Mode" workflow | ||
environment_targets: production |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
"": | ||
- type: ALIAS | ||
value: ghtrending.pages.dev. | ||
octodns: | ||
cloudflare: | ||
proxied: true | ||
auto-ttl: true | ||
|
||
- type: MX | ||
values: | ||
- exchange: route3.mx.cloudflare.net. | ||
preference: 5 | ||
- exchange: route2.mx.cloudflare.net. | ||
preference: 82 | ||
- exchange: route1.mx.cloudflare.net. | ||
preference: 95 | ||
octodns: | ||
cloudflare: | ||
proxied: false | ||
auto-ttl: true | ||
|
||
- type: TXT | ||
values: | ||
- v=spf1 include:_spf.mx.cloudflare.net ~all | ||
- google-site-verification=MDJ0aMnhpJc7hbCnUs8z0jbizoNXorxW7Q13FenzOpU | ||
octodns: | ||
cloudflare: | ||
proxied: false | ||
auto-ttl: true | ||
|
||
ingest: | ||
- type: A | ||
value: 20.172.212.22 | ||
octodns: | ||
cloudflare: | ||
proxied: false | ||
auto-ttl: true | ||
|
||
data: | ||
- type: CNAME | ||
value: data.ghtrending.io.s3-website-us-east-1.amazonaws.com. | ||
octodns: | ||
cloudflare: | ||
proxied: true | ||
auto-ttl: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
providers: | ||
config: | ||
class: octodns.provider.yaml.YamlProvider | ||
directory: ./config | ||
default_ttl: 3600 | ||
enforce_order: false | ||
|
||
cloudflare: | ||
class: octodns_cloudflare.CloudflareProvider | ||
# Required permissions for API Tokens are Zone:Read, DNS:Read and DNS:Edit. | ||
# Page Rules:Edit is required for managing Page Rules (URLFWD) records. | ||
token: env/CLOUDFLARE_TOKEN | ||
# Optional. Filter by account ID in environments where a token has access | ||
# across more than the permitted number of accounts allowed by Cloudflare. | ||
account_id: env/CLOUDFLARE_ACCOUNT_ID | ||
# Manage Page Rules (URLFWD) records | ||
pagerules: false # disabled for now by me | ||
# Optional. Default: 4. Number of times to retry if a 429 response | ||
# is received. | ||
retry_count: 10 | ||
# Optional. Default: 300. Number of seconds to wait before retrying. | ||
retry_period: 300 | ||
# Optional. Default: 50. Number of zones per page. | ||
zones_per_page: 50 | ||
# Optional. Default: 100. Number of dns records per page. | ||
records_per_page: 100 | ||
# Optional. Default: 120. Lowest TTL allowed to be set. | ||
# A different limit for (non-)enterprise zone applies. | ||
# See: https://developers.cloudflare.com/dns/manage-dns-records/reference/ttl | ||
min_ttl: 120 | ||
|
||
manager: | ||
plan_outputs: | ||
html: | ||
class: octodns.provider.plan.PlanHtml | ||
|
||
zones: | ||
# This is a dynamic zone config. The source(s), here `config`, will be | ||
# queried for a list of zone names and each will dynamically be set up to | ||
# match the dynamic entry. | ||
"*": | ||
sources: | ||
- config | ||
targets: | ||
- cloudflare |