-
Notifications
You must be signed in to change notification settings - Fork 126
90 lines (75 loc) · 2.85 KB
/
build_dockers_debian11.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
name: Build Navitia Dockers debian11 (ARM64)
on:
push:
branches:
- _dev
# tags:
# - '*'
env:
debian_version: debian11
jobs:
build_navitia_arm64:
runs-on: ubuntu-latest
steps:
- name: Generate github private access token
id: ci-core-app-token
uses: getsentry/action-github-app-token@v2.0.0
with:
app_id: ${{ secrets.CI_CORE_APP_ID }}
private_key: ${{ secrets.CI_CORE_APP_PEM }}
- uses: actions/checkout@v3
with:
submodules: recursive
token: ${{ steps.ci-core-app-token.outputs.token }}
# we need entire history for tags
# we need entire history for tags
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: linux/arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
platforms: linux/arm64
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{secrets.docker_user}}
password: ${{secrets.docker_password}}
- name: Build Navitia
run: |
docker buildx build --platform linux/arm64 --file docker/debian11_arm64/Dockerfile-builder --tag navitia/builder_arm64:latest .
docker run --rm --platform linux/arm64 -v `pwd`:/navitia/navitia/ navitia/builder_arm64:latest
- name: Choose dev tag
run: |
echo "building version dev"
echo "navitia_tag=dev" >> $GITHUB_ENV
echo "aws_branch=dev" >> $GITHUB_ENV
- name: Choose release tag
if: startsWith(github.ref, 'refs/tags/')
run: |
version=$(git describe --tags)
echo "building version $version"
echo "navitia_tag=$version" >> $GITHUB_ENV
echo "aws_branch=release" >> $GITHUB_ENV
# https://github.com/marketplace/actions/build-and-push-docker-images
- name: Build and push jormungandr
uses: docker/build-push-action@v4
with:
context: .
file: docker/debian11_arm64/Dockerfile-jormungandr
push: false
tags: navitia/jormungandr_arm64:${{env.navitia_tag}}
platforms: linux/arm64
- name: Install dependencies
run: |
sudo apt update && sudo apt install -y --force-yes httpie
- name: failure notification
if: failure()
run: |
echo '{"text":":warning: Github Actions: build_dockers on arm64 for ${{env.navitia_tag}} failed !"}' | http --json POST ${{secrets.SLACK_NAVITIA_TEAM_URL}}
- name: success notification on core team
if: success()
run: |
echo '{"text":":octopus: Github Actions: build_dockers on arm64 has succeeded. New navitia ${{env.navitia_tag}}_arm64 images available."}' | http --json POST ${{secrets.SLACK_NAVITIA_TEAM_URL}}