Skip to content

docker

docker #2

Workflow file for this run

name: docker
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get version
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
if [ -z "$VERSION" ]; then
echo "RELEASE_VERSION=${{ inputs.version }}" >> $GITHUB_ENV
fi
env:
VERSION: ${{ inputs.version }}
- name: Build phar
run: php -d phar.readonly=0 bin/build -v"$RELEASE_VERSION"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: deployphp
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: deployphp/deployer:${{ env.RELEASE_VERSION }}