Skip to content

build-push-latest-version #37

build-push-latest-version

build-push-latest-version #37

name: build-push-latest-version
on:
workflow_dispatch:
push:
paths-ignore:
- README.md
- LICENSE
- docker-compose.yml
- docker-compose-multi.yml
branches:
- master
jobs:
build-push-latest:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Get version from Dockerfile
id: version_provider
run: |
VERSION=$(grep 'ARG BASE_VERSION' Dockerfile | awk -F= '{print $2}')
echo "::set-output name=version::$VERSION"
- name: debug
run: |
echo "::debug:: ${{steps.version_provider.outputs.version}}"
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
platforms: linux/amd64,linux/arm64
push: true
cache-from: |
dcagatay/pwless-pgadmin4:latest
tags: |
dcagatay/pwless-pgadmin4:latest
dcagatay/pwless-pgadmin4:${{steps.version_provider.outputs.version}}