Prepare mage for 1.14.1 release (#443) #91
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Docker image | |
on: | |
push: | |
tags: | |
- v*.*-memgraph-*.* | |
- v*.*.*-memgraph-*.* | |
jobs: | |
build_and_release_docker: | |
name: Build & release Docker image with tag | |
runs-on: ubuntu-latest | |
env: | |
DOCKER_ORGANIZATION_NAME: memgraph | |
DOCKER_REPOSITORY_NAME: memgraph-mage | |
MEMGRAPH_VERSION: 2.14.1 | |
steps: | |
- name: Checkout repository and submodules | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Get latest tag | |
id: get-latest-tag | |
uses: oprypin/find-latest-tag@v1 | |
with: | |
repository: memgraph/mage | |
releases-only: false | |
prefix: "v" | |
- run: echo "MAGE is at version ${{ steps.get-latest-tag.outputs.tag }}" | |
- name: Get commit tag | |
id: get-commit-tag | |
run: | | |
export VERSION=${GITHUB_REF#refs/tags/} | |
echo "::set-output name=VERSION_TAG::${VERSION:1}" | |
echo "::set-output name=VERSION::${VERSION}" | |
- name: Get version | |
run: echo "Version is ${{ steps.get-commit-tag.outputs.VERSION }}" | |
- name: Set production tag | |
id: get-prod-tags | |
run: | | |
if [ "${{ steps.get-commit-tag.outputs.VERSION }}" == "${{ steps.get-latest-tag.outputs.tag }}" ] | |
then | |
echo "::set-output name=LATEST::latest" | |
else | |
echo "::set-output name=LATEST::fix" | |
fi | |
- run: echo "Additional tag for production image - ${{ steps.get-prod-tags.outputs.LATEST }}" | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Download memgraph binary | |
run: | | |
curl -L https://download.memgraph.com/memgraph/v${MEMGRAPH_VERSION}/debian-11/memgraph_${MEMGRAPH_VERSION}-1_amd64.deb > memgraph-amd64.deb | |
curl -L https://download.memgraph.com/memgraph/v${MEMGRAPH_VERSION}/debian-11-aarch64/memgraph_${MEMGRAPH_VERSION}-1_arm64.deb > memgraph-arm64.deb | |
- name: Build & push prod docker images | |
run: | | |
docker buildx build \ | |
--target prod \ | |
--platform linux/amd64,linux/arm64 \ | |
--tag $DOCKER_ORGANIZATION_NAME/$DOCKER_REPOSITORY_NAME:${{ steps.get-commit-tag.outputs.VERSION_TAG }} \ | |
--tag $DOCKER_ORGANIZATION_NAME/$DOCKER_REPOSITORY_NAME:${{ steps.get-prod-tags.outputs.LATEST }} \ | |
--file Dockerfile.release \ | |
--push . | |
- name: Build & push dev docker images | |
run: | | |
docker buildx build \ | |
--target dev \ | |
--platform linux/amd64,linux/arm64 \ | |
--tag $DOCKER_ORGANIZATION_NAME/$DOCKER_REPOSITORY_NAME:${{ steps.get-commit-tag.outputs.VERSION_TAG }}-dev \ | |
--file Dockerfile.release \ | |
--push . |