Skip to content

Build & Publish Docker image #84

Build & Publish Docker image

Build & Publish Docker image #84

Workflow file for this run

name: Build & Publish Docker image
on:
pull_request:
branches: [main]
paths:
- '**'
- '!example/**'
- '!*.md'
push:
branches: [main]
paths:
- '**'
- '!example/**'
- '!*.md'
release:
types:
- published
jobs:
build-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set tag variable
id: set_tag
run: echo ::set-output name=tag::$(if [ "${{ github.event_name }}" == 'release' ]; then echo "${{ github.ref_name }}"; else echo "0.0.0-dev"; fi)
- name: Build and publish to Docker Hub
uses: docker/build-push-action@v2
timeout-minutes: 60
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name == 'release' }}
tags: "nhost/functions:20-${{ steps.set_tag.outputs.tag }}"
file: 18.Dockerfile
- name: Build and publish to Docker Hub
uses: docker/build-push-action@v2
timeout-minutes: 60
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name == 'release' }}
tags: "nhost/functions:20-${{ steps.set_tag.outputs.tag }}"
file: 20.Dockerfile