Skip to content

chore(deps-dev): bump @semantic-release/commit-analyzer from 10.0.1 to 13.0.0 #477

chore(deps-dev): bump @semantic-release/commit-analyzer from 10.0.1 to 13.0.0

chore(deps-dev): bump @semantic-release/commit-analyzer from 10.0.1 to 13.0.0 #477

name: Publish to Docker Hub
on:
workflow_dispatch:
push:
branches:
- 'main'
release:
types: [published]
pull_request:
branches:
- 'main'
jobs:
check_secrets:
runs-on: ubuntu-latest
outputs:
secrets_available: ${{ steps.check.outputs.secrets_available }}
steps:
- id: check
run: |
if [[ -n "${{ secrets.DOCKERHUB_USERNAME }}" && -n "${{ secrets.DOCKERHUB_TOKEN }}" ]]; then
echo "::set-output name=secrets_available::true"
else
echo "::set-output name=secrets_available::false"
fi
shell: bash
publish:
runs-on: ubuntu-latest
needs: check_secrets
if: ${{ needs.check_secrets.outputs.secrets_available == 'true' }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
katsuba/nx-cloud
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- 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 }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./apps/api/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: |
linux/amd64
linux/arm64/v8