forked from peter-evans/nominatim-k8s
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (72 loc) · 2.21 KB
/
ci.yaml
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
name: Build
on:
push:
branches: [main]
pull_request:
types: [opened, reopened, synchronize]
release:
types: [published]
schedule:
- cron: '15 3 * * 0'
jobs:
container_build:
runs-on: ubuntu-20.04
name: Container Build
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Generate image tags for releaes
if: ${{ github.event_name == 'release' }}
shell: bash
run: echo "##[set-output name=tags;]quay.io/rebuy/nominatim-k8s:${GITHUB_REF#refs/tags/}"
id: generate_tags_release
- name: Generate image tags for PRs
if: ${{ github.event_name != 'release' }}
shell: bash
run: |
if [ "${GITHUB_EVENT_NAME}" == "pull_request" ]; then
echo "##[set-output name=tags;]quay.io/rebuy/nominatim-k8s:${GITHUB_HEAD_REF}"
else
echo "##[set-output name=tags;]quay.io/rebuy/nominatim-k8s:master,quay.io/rebuy/nominatim-k8s:main,\
quay.io/rebuy/nominatim-k8s:latest"
fi
id: generate_tags_pr
- name: Set up QEMU
if: ${{ github.event_name == 'release' }}
id: qemu
uses: docker/setup-qemu-action@v1
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
install: true
# Only used to prevent rate limits
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to Quay.io
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Build and push
if: ${{ github.event_name == 'release' }}
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.generate_tags_release.outputs.tags }}
platforms: linux/amd64,linux/arm64
- name: Build and push
if: ${{ github.event_name != 'release' }}
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.generate_tags_pr.outputs.tags }}
platforms: linux/amd64