This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CD | Build-Test-Release | |
on: | |
push: | |
branches: | |
- "main" | |
release: | |
types: [published] | |
workflow_dispatch: | |
inputs: | |
image_tag: | |
description: "Docker Image Tag" | |
required: false | |
default: "dev" | |
jobs: | |
docker-build: | |
runs-on: ubuntu-latest | |
# DO is a custom runner deployed on DigitalOcean, only available for workflows under the runpod-workers organization. | |
# If you would like to use this workflow, you can replace DO with ubuntu-latest or any other runner. | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: '0' | |
- name: Minor version for each merge | |
id: taggerDryRun | |
uses: anothrNick/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
WITH_V: true | |
DRY_RUN: true | |
- name: echo new tag | |
run: | | |
echo "The next tag version will be: ${{ steps.taggerDryRun.outputs.new_tag }}" | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
# Build and push step | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
push: true | |
tags: ${{ vars.DOCKERHUB_REPO }}/${{ vars.DOCKERHUB_IMG }}:${{ steps.taggerDryRun.outputs.new_tag }} | |