Skip to content

Commit

Permalink
Add workflow to auto deploy
Browse files Browse the repository at this point in the history
Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
  • Loading branch information
VietND96 committed Dec 1, 2023
1 parent 26a5b6b commit 9d332df
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/ndviet-ffmpeg-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
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/retry@v2.9.0
with:
timeout_minutes: 20
max_attempts: 3
command: docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"

- name: Build image
uses: nick-invision/retry@v2.9.0
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/retry@v2.9.0
with:
timeout_minutes: 20
max_attempts: 3
command: docker push $NAMESPACE/ffmpeg:$VERSION-$BASED_OS

0 comments on commit 9d332df

Please sign in to comment.