Skip to content

Deploy Photographer Docker Image #43

Deploy Photographer Docker Image

Deploy Photographer Docker Image #43

name: Deploy Photographer Docker Image
on:
workflow_dispatch:
inputs:
version:
required: true
default: 'release'
description: 'Tezos image version or tag'
jobs:
docker:
runs-on: ubuntu-latest
steps:
- if: github.event_name == 'workflow_dispatch'
run: |
VERSION=${{ github.event.inputs.version }}
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Pipeline has been triggered manually. Setting version variable to $VERSION"
env:
VERSION: ${{ github.event.inputs.version }}
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: docker_build_photographer
uses: docker/build-push-action@v3
with:
file: photographer.Dockerfile
context: .
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
VERSION=${{ env.VERSION }}
# Only push if on main branch
push: ${{ github.ref == 'refs/heads/main' }}
tags: |
ghcr.io/marigold-dev/photographer:latest
ghcr.io/marigold-dev/photographer:${{ env.VERSION }}
ghcr.io/marigold-dev/photographer:${{ github.sha }}