-
Notifications
You must be signed in to change notification settings - Fork 210
49 lines (43 loc) · 1.29 KB
/
docker-push.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
name: docker-push
on:
push:
branches:
- main
tags:
- "v*"
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: docker meta
id: meta
uses: docker/[email protected]
with:
images: fsouza/fake-gcs-server
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: setup qemu
uses: docker/[email protected]
- name: setup buildx
id: buildx
uses: docker/[email protected]
- name: login to docker hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: build and push
uses: docker/[email protected]
with:
cache-from: fsouzaci/gha-cache:fake-gcs-server
cache-to: fsouzaci/gha-cache:fake-gcs-server
context: .
push: ${{ github.ref_type == 'tag' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64