-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (45 loc) · 1.63 KB
/
build-on-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
name: Build
on:
push:
workflow_dispatch:
env:
REGISTRY: ghcr.io
jobs:
build:
runs-on: ubuntu-latest
if: >-
${{ !contains(github.event.head_commit.message, '[ci skip]') &&
!contains(github.event.head_commit.message, '[skip ci]')
}}
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
include:
- VERSION: "5.0.13"
- VERSION: "6.0.2"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Submodule init
shell: bash
run: git submodule init
- name: Set up QEMU dependency
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker Image And Push To GHCR And Docker Hub
shell: bash
run: |
export repository=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')
cd docker
docker buildx build --build-arg VERSION=${{ matrix.VERSION }} -f Dockerfile -t ${{ env.REGISTRY }}/${repository}/mongodb:${{ matrix.VERSION }} --push --platform=linux/amd64,linux/arm64 .
docker buildx build --build-arg VERSION=${{ matrix.VERSION }} -f Dockerfile.bitnami-compat -t ${{ env.REGISTRY }}/${repository}/bitnami-compat-mongodb:${{ matrix.VERSION }} --push --platform=linux/amd64,linux/arm64 .