forked from splitio/split-synchronizer
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (56 loc) · 2 KB
/
docker.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
name: Build proxy docker image
on:
push:
branches:
- master
pull_request:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.run_number || github.event.pull_request.number }}
cancel-in-progress: true
jobs:
docker:
name: Build Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: amd64,arm64
# Create a build container which buildx will u
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.CI_PAT }}
- name: Setup Docker layer Cache
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-docker-${{ github.event.number }}
restore-keys: ${{ runner.os }}-docker-
# Automagically extract useful information from the current github context and creates
# a set of labels for use by build-push-action to be attached to the final image.
- name: Extract Metadata for Docker
uses: docker/metadata-action@v4
with:
images: ${{ github.repository }}
id: meta
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: docker/Dockerfile.proxy
tags: ghcr.io/${{ github.repository }}:PR${{ github.event.number }}
# We use local cache type, so we can clean up the cache
# https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md#local-cache
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new
labels: ${{ steps.meta.outputs.labels }}
push: true