-
Notifications
You must be signed in to change notification settings - Fork 26
50 lines (43 loc) · 1.4 KB
/
main.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
name: Main
on:
push:
pull_request:
env:
IMAGE_NAME: bot
jobs:
main:
name: main
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: install node v12
uses: actions/setup-node@v1
with:
node-version: 12
- name: yarn install
run: yarn install
- name: build
run: yarn run build
- name: lint
run: yarn run lint
- name: Set up Docker Buildx
if: contains(github.ref, 'master')
uses: docker/setup-buildx-action@v1
- name: Login to Github Container Registry
if: contains(github.ref, 'master')
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Build and push
if: contains(github.ref, 'master')
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
cache-from: type=registry,ref=ghcr.io/typescript-community/bot:latest
cache-to: type=inline
tags: |
ghcr.io/typescript-community/bot:latest