Skip to content

Add workflow to auto deploy #1

Add workflow to auto deploy

Add workflow to auto deploy #1

name: Deploys
on:
push:
branches:
- deploy
workflow_dispatch:
inputs:
VERSION:
description: 'Version to deploy'
required: true
default: '6.1'
BASED_OS:
description: 'Based OS to build'
required: true
default: 'ubuntu2204'
jobs:
deploy:
name: Deploy Docker images
runs-on: ubuntu-latest
env:
NAMESPACE: ${{secrets.DOCKER_HUB_NAMESPACE}}
DOCKER_USERNAME: ${{secrets.DOCKER_HUB_USER}}
DOCKER_PASSWORD: ${{secrets.DOCKER_HUB_TOKEN}}
VERSION: ${{ github.event.inputs.VERSION }}
BASED_OS: ${{ github.event.inputs.BASED_OS }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- name: Docker login
uses: nick-invision/[email protected]
with:
timeout_minutes: 20
max_attempts: 3
command: docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- name: Build image
uses: nick-invision/[email protected]
with:
timeout_minutes: 20
max_attempts: 3
command: cd docker-images/$VERSION/$BASED_OS; docker build . -t $NAMESPACE/ffmpeg:$VERSION-$BASED_OS
- name: Push image
uses: nick-invision/[email protected]
with:
timeout_minutes: 20
max_attempts: 3
command: docker push $NAMESPACE/ffmpeg:$VERSION-$BASED_OS