feat: include workflow version in image #132
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
name: ci | |
on: | |
pull_request: | |
branches: | |
- "*" | |
push: | |
branches: | |
- "main" | |
jobs: | |
commitlint: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: commitlint | |
uses: wagoid/commitlint-github-action@v5 | |
test: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Docker | |
uses: docker/setup-buildx-action@v3 | |
- name: Build | |
id: build | |
uses: docker/build-push-action@v5 | |
with: | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
context: . | |
load: true | |
target: test | |
- name: Test | |
run: docker run --rm -t ${{ steps.build.outputs.imageid }} pytest | |
release: | |
runs-on: ubuntu-22.04 | |
needs: [test, commitlint] | |
if: github.event_name == 'push' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install semantic-release | |
run: npm i [email protected] [email protected] | |
- name: Release | |
env: | |
GITHUB_USERNAME: ${{ secrets.GH_USERNAME }} | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
run: npx semantic-release |