2022-07-22 18:21:29 +03:00
|
|
|
name: Docker
|
|
|
|
on:
|
2023-10-16 03:13:17 +03:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2022-07-22 18:21:29 +03:00
|
|
|
release:
|
|
|
|
types: [published]
|
|
|
|
env:
|
|
|
|
REGISTRY: ghcr.io
|
|
|
|
IMAGE_NAME: ${{ github.repository }}
|
|
|
|
jobs:
|
2022-07-23 17:02:38 +03:00
|
|
|
check-token:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
token: ${{ steps.token.outputs.defined }}
|
|
|
|
steps:
|
|
|
|
- id: token
|
|
|
|
env:
|
|
|
|
MY_TOKEN: ${{ secrets.MY_TOKEN }}
|
|
|
|
if: "${{ env.MY_TOKEN != '' }}"
|
|
|
|
run: echo "::set-output name=defined::true"
|
|
|
|
|
2022-07-22 18:21:29 +03:00
|
|
|
build:
|
|
|
|
name: Release
|
|
|
|
runs-on: ubuntu-latest
|
2022-07-23 17:02:38 +03:00
|
|
|
needs: [check-token]
|
|
|
|
if: needs.check-token.outputs.token == 'true'
|
2022-07-22 18:21:29 +03:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- 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 the Container registry
|
|
|
|
uses: docker/login-action@v2
|
|
|
|
with:
|
|
|
|
registry: ${{ env.REGISTRY }}
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.MY_TOKEN }}
|
|
|
|
- name: Extract metadata (tags, labels) for Docker
|
|
|
|
id: meta
|
|
|
|
uses: docker/metadata-action@v4
|
|
|
|
with:
|
|
|
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
|
|
- name: Build and push Docker image
|
2022-11-10 11:49:38 +03:00
|
|
|
uses: docker/build-push-action@v3
|
2022-07-22 18:21:29 +03:00
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: docker/Dockerfile
|
2022-11-10 11:49:38 +03:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2022-07-22 18:21:29 +03:00
|
|
|
push: true
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
2022-11-10 11:49:38 +03:00
|
|
|
build-args: |
|
2022-07-24 14:08:14 +03:00
|
|
|
INCLUDE_MONGODBTOOLS=true
|
|
|
|
PREINSTALL_LIBS=true
|