Bump pre-commit from 3.8.0 to 4.0.1 (#160) #502
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: | |
push: | |
branches: [master] | |
tags: [v*] | |
pull_request: | |
branches: [master] | |
jobs: | |
test: | |
name: All checks are passed | |
uses: ./.github/workflows/test.yaml | |
approve: | |
name: Approve bot PR | |
runs-on: ubuntu-latest | |
if: endsWith(github.actor, '[bot]') | |
needs: test | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: metadata | |
id: metadata | |
if: github.actor == 'dependabot[bot]' | |
uses: dependabot/fetch-metadata@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Enable auto-merge for bot PRs | |
run: gh pr merge --auto --squash --delete-branch "$PR_URL" | |
env: | |
PR_URL: ${{ github.event.pull_request.html_url }} | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
deploy: | |
name: Build and push Docker image | |
needs: test | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Checkout commit | |
uses: actions/checkout@v4 | |
- name: Sanity check for tag and version | |
run: | | |
export VERSION=${{ needs.test.outputs.version }} | |
if [ "${{ github.ref }}" != "refs/tags/v$VERSION" ] | |
then | |
echo "Git tag '${{ github.ref }}' differs from hard-coded package version 'v$VERSION'" | |
exit 1 | |
else | |
echo "OK, git tag matches hard-coded package version: 'v$VERSION'" | |
fi | |
- name: Login to Github container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build | |
env: | |
VERSION: ${{ needs.test.outputs.version }} | |
COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | |
run: | | |
docker build \ | |
-t "ghcr.io/neuro-inc/wabucketref:${VERSION}" \ | |
-t "ghcr.io/neuro-inc/wabucketref:latest" \ | |
--build-arg COMMIT_SHA=${COMMIT_SHA} \ | |
. | |
- name: Push | |
env: | |
VERSION: ${{ needs.test.outputs.version }} | |
run: | | |
docker push ghcr.io/neuro-inc/wabucketref --all-tags |