Skip to content

Commit

Permalink
chore: build docker image in action
Browse files Browse the repository at this point in the history
  • Loading branch information
demtario committed Mar 25, 2024
1 parent 4337f6c commit 60bb9ad
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,33 @@ on:
push:
tags:
- '*'
branches:
- master
- develop
- hotfix/*
- release/*
jobs:
run:
runs-on: docker:latest
runs-on: docker-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_LOGIN }}
password: ${{ secrets.PASSWORD }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create image tag
env:
IMAGE_TAG: '${{ github.ref_name }}'
run: echo "IMAGE_TAG=${IMAGE_TAG/\//-}" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: heseya/admin:${{ github.ref_name }}
tags: heseya/admin:${{ env.IMAGE_TAG }}
2 changes: 1 addition & 1 deletion .github/workflows/trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: python version
- name: Create image tag
env:
IMAGE_NAME: '${{ github.ref_name }}'
run: echo "IMAGE_NAME=${IMAGE_NAME/\//-}" >> $GITHUB_ENV
Expand Down

0 comments on commit 60bb9ad

Please sign in to comment.