-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (54 loc) · 1.63 KB
/
pull-request.yml
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: PR
on: [pull_request]
jobs:
build:
name: Lint, format, test and build
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Use Node LTS ✨
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: yarn
- name: Installing dependencies 📦️
run: yarn install --immutable
- name: Lint 💅
run: yarn lint
- name: Format 🔍
run: yarn format:check
- name: Test 🧪
run: yarn test --passWithNoTests
- name: Build 🔨
run: yarn build
build-container:
name: Build container
runs-on: ubuntu-latest
env:
# Consider replacing Docker repository below, e.g. like this:
# IMAGE_NAME: ${{ secrets.CONTAINER_REPOSITORY }}/${{ inputs.name }}
IMAGE_NAME: bjerkio/${{ github.event.repository.name }}
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Docker meta 🏷
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=ref,event=pr
- name: Set up Docker Buildx 🔨
id: buildx
uses: docker/setup-buildx-action@v2
- name: Build Docker 🛠
uses: docker/build-push-action@v4
with:
context: ./
file: ./Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# Uncomment to enable caching
# cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:latest
cache-to: type=inline