Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix build docker image with github actions
Browse files Browse the repository at this point in the history
ilyarolf committed Dec 3, 2024
1 parent 2fce14e commit f69fcce
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ name: Build and Push Docker Image

on:
push:
branches: [master, feature/sqlalchemy-sqlcipher]
branches: [master, develop, fix/github-actions]

jobs:
build-and-push:
@@ -19,11 +19,24 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Get branch name
id: branch_name
run: echo "::set-output name=BRANCH_NAME::$GITHUB_REF##*/"

- name: Generate tag
id: generate_tag
run: |
if [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then
TAG="${{ github.repository }}-develop"
else
TAG="${{ github.repository }}"
fi
echo "::set-output name=TAG::$TAG"
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/aiogram-shop-bot:latest
- name: clean all
run: rm -rf ./*
tags: ${{ steps.generate_tag.outputs.TAG }}

0 comments on commit f69fcce

Please sign in to comment.