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

v0.2.51

v0.2.51 #99

name: docker-app-push
on:
push:
branches:
- 'main'
paths:
- "src/**"
release:
types: [published]
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Set Docker tag based on release name or commit hash
run: |
if [[ "${{ github.event.release.name }}" != "" ]]; then
echo "DOCKER_TAG=${{ github.event.release.name }}" >> $GITHUB_ENV
else
echo "DOCKER_TAG=${{ github.sha }}" >> $GITHUB_ENV
fi
-
name: Build and push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
file: ./Dockerfile
push: true
tags: ghcr.io/${{ github.actor }}/tech-blog-backend:${{ env.DOCKER_TAG }}