Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Build and Optionally Release #232

Build and Optionally Release

Build and Optionally Release #232

Workflow file for this run

---
name: Build and Optionally Release
on: # yamllint disable-line rule:truthy
pull_request:
push:
branches:
- main
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v2
with:
image: tonistiigi/binfmt:latest
platforms: all
- name: Setup buildx
uses: docker/setup-buildx-action@v2
- name: Build Only
uses: docker/bake-action@v2
with:
files: |
./docker-bake.hcl
- name: Release
id: release
uses: ahmadnassri/action-semantic-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Login to DockerHub
if: steps['release']['outputs']['published'] == 'true'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build & Push
if: steps['release']['outputs']['published'] == 'true'
uses: docker/bake-action@v2
env:
TAG: ${{steps.release.outputs.release-version}}
with:
push: 'true'