This repository has been archived by the owner on Nov 3, 2024. It is now read-only.
v0.2.3 #90
Workflow file for this run
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: 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 Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_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: ${{ secrets.DOCKERHUB_USERNAME }}/draft-backend:${{ env.DOCKER_TAG }} |