forked from 2mug1/paper
-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (38 loc) · 1.21 KB
/
build.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
name: Build and Push Image
on:
release:
types: [published]
workflow_dispatch:
env:
DOCKER_REGISTRY_NAME: ghcr.io
DOCKER_IMAGE_NAME: ${{ github.repository }} # {username|org}/paper
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Registry
uses: docker/login-action@v1
with:
registry: ${{ env.DOCKER_REGISTRY_NAME }}
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.DOCKER_REGISTRY_NAME }}/${{ env.DOCKER_IMAGE_NAME }}
- name: Build & Push
uses: docker/build-push-action@v2
env:
DOCKER_BUILDKIT: 1
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: ${{ env.DOCKER_REGISTRY_NAME }}/${{ env.DOCKER_IMAGE_NAME }}:latest
build-args: BUILDKIT_INLINE_CACHE=1