Skip to content

usw docker/build-push-action@v4 #230

usw docker/build-push-action@v4

usw docker/build-push-action@v4 #230

Workflow file for this run

name: Docker
on:
# We try to build image on each PR.
pull_request: ~
# When tagged, we also push the image to the docker registry.
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
name: Docker image build
env:
publish: ${{ github.event_name == 'push' }}
repository: 'nunomaduro/phpinsights'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get Release version
run: echo "RELEASE_VERSION=$(echo ${GITHUB_REF:10})" >> $GITHUB_ENV
if: ${{ env.publish == 'true' }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
tags: ${{ env.repository }}:latest , ${{ env.repository }}:${{ env.RELEASE_VERSION }}
push: true
if: ${{ env.publish == 'true' }}