-
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.
ci: Add github actions for validation and release
- Loading branch information
Showing
3 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
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,10 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: terraform | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
- package-ecosystem: github-actions | ||
directory: "/" | ||
schedule: | ||
interval: daily |
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,29 @@ | ||
name: pre-commit | ||
on: | ||
push: | ||
branches: ["*"] | ||
jobs: | ||
pre-commit: | ||
permissions: read-all | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/antonbabenko/pre-commit-terraform:v1.86.0 | ||
steps: | ||
- name: Install job dependencies | ||
run: apk add tar git | ||
- uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache | ||
key: pre-commit | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Ensure cache directories | ||
run: | | ||
mkdir -p ~/.cache/pip | ||
mkdir -p ~/.cache/pre-commit | ||
- name: Run pre-commit-hooks | ||
run: | | ||
git config --global --add safe.directory $PWD | ||
pre-commit run --all-files --color=always --show-diff-on-failure |
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,43 @@ | ||
name: semantic-release | ||
on: | ||
workflow_run: | ||
workflows: [pre-commit] | ||
types: [completed] | ||
branches: [master] | ||
jobs: | ||
semantic-release: | ||
permissions: | ||
contents: write # to be able to publish a GitHub release | ||
issues: write # to be able to comment on released issues | ||
pull-requests: write # to be able to comment on released pull requests | ||
id-token: write # to enable use of OIDC for npm provenance | ||
runs-on: ubuntu-latest | ||
container: | ||
image: node:lts-alpine3.19 | ||
env: | ||
NPM_CACHE_DIR: ~/.cache/npm | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
steps: | ||
- name: Install job dependencies | ||
run: apk add tar git | ||
- uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache | ||
key: semantic-release | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install semantic-release and plugins | ||
run: npm install --cache $NPM_CACHE_DIR | ||
semantic-release | ||
@semantic-release/github | ||
@semantic-release/changelog | ||
@semantic-release/git | ||
@semantic-release/exec | ||
conventional-changelog-conventionalcommits | ||
- name: Run semantic-release | ||
run: | | ||
git config --global --add safe.directory $PWD | ||
npx semantic-release |