Skip to content

Commit

Permalink
ci: Add github actions for validation and release
Browse files Browse the repository at this point in the history
  • Loading branch information
s-diez committed Jan 8, 2024
1 parent b475902 commit e567cc1
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yaml
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
29 changes: 29 additions & 0 deletions .github/workflows/pre-commit.yml
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
43 changes: 43 additions & 0 deletions .github/workflows/semantic-release.yml
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

0 comments on commit e567cc1

Please sign in to comment.