Skip to content

Push tagged image

Push tagged image #432

name: Push tagged image
defaults:
run:
shell: bash
on:
workflow_dispatch:
inputs:
image:
description: 'Image to push'
required: true
default: ddev-webserver
type: choice
options:
- ddev-gitpod-base
- ddev-php-base
- ddev-webserver
- ddev-ssh-agent
- ddev-traefik-router
- test-ssh-server
tag:
description: Tag for pushed image (v1.24.5 for example)
required: true
default: ""
debug_enabled:
description: 'Enable debug mode'
type: boolean
required: false
default: false
env:
REGISTRY: docker.io
DOCKER_ORG: ${{ vars.DOCKER_ORG }}
TAG: "${{ github.event.inputs.tag }}"
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: read
jobs:
push-tagged-image:
name: "push tagged image"
runs-on: ubuntu-latest
steps:
- name: Load 1password secret(s)
uses: 1password/load-secrets-action@v2
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == github.repository_owner }}
with:
export-env: true
env:
OP_SERVICE_ACCOUNT_TOKEN: "${{ secrets.PUSH_SERVICE_ACCOUNT_TOKEN }}"
DOCKERHUB_TOKEN: "op://push-secrets/DOCKERHUB_TOKEN/credential"
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ env.DOCKERHUB_TOKEN }}
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
github-token: ${{ secrets.GITHUB_TOKEN }}
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
- name: Push ${{ github.event.inputs.image }} image
if: github.event.inputs.image != 'ddev-dbserver' && github.event.inputs.image != 'all'
run: |
cd "containers/${{ github.event.inputs.image }}"
make push VERSION="${{ github.event.inputs.tag }}"
- name: Push all images (not in use)
if: github.event.inputs.image == 'all'
run: |
cd "containers"
VERSION="${{ github.event.inputs.tag }}" ./push-all.sh
- name: Push ${{ github.event.inputs.image }} ddev-dbserver image
if: github.event.inputs.image == 'ddev-dbserver'
run: |
cd "containers/${{ github.event.inputs.image }}"
make PUSH=true VERSION="${{ github.event.inputs.tag }}" DOCKER_ORG=${DOCKER_ORG}