-
Notifications
You must be signed in to change notification settings - Fork 1
95 lines (80 loc) · 2.49 KB
/
publish.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Publish
on:
push:
branches:
- main
jobs:
dockerhub:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
with:
fetch-depth: 0
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
pomerium/datasource
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha
type=raw,value=main,enable={{is_default_branch}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to cloudsmith registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
file: pomerium-datasource.dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
gcr:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
with:
fetch-depth: 0
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
gcr.io/pomerium-registry/pomerium-datasource-ip2location
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: gcloud authenticate
uses: google-github-actions/auth@ef5d53e30bbcd8d0836f4288f5e50ff3e086997d
with:
project_id: ${{ secrets.GCP_PRODUCTION_PROJECT_ID }}
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT }}
- name: gcloud sdk
uses: google-github-actions/setup-gcloud@d51b5346f85640ec2aa2fa057354d2b82c2fcbce
- name: Log in to gcr registry
run: gcloud auth configure-docker
- name: Build
uses: docker/build-push-action@v3
with:
context: .
file: pomerium-datasource-ip2location.dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
secrets: |
"download_token=${{ secrets.IP2LOCATION_DOWNLOAD_TOKEN }}"