-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (40 loc) · 1.2 KB
/
build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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