fix: lint run in workflow #2
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: Regular lint, build and deploy to private registry (if commit message contains ~deploy~) | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies and lint, then build | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
- run: npm i -f | |
- run: npm run lint | |
- run: npm run build | |
docker: | |
name: Create docker image and push to private registry | |
runs-on: ubuntu-latest | |
if: "contains(github.event.head_commit.message, '~deploy~')" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to registry | |
uses: docker/login-action@v2 | |
with: | |
context: . | |
registry: ${{ secrets.REGISTRY_URL }} | |
username: ${{ secrets.REGISTRY_LOGIN }} | |
password: ${{ secrets.REGISTRY_PASSWORD }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
push: true | |
tags: ${{ secrets.REGISTRY_URL }}/${{ github.event.repository.name }}:latest | |
env: | |
DOCKER_BUILDKIT: 1 |