Skip to content

Commit f3148f7

Browse files
committed
ci: only build on branches that are not "main"; use docker bake
1 parent 3bd38f0 commit f3148f7

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

.github/workflows/dev.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: Development
33
on:
44
workflow_dispatch:
55
push:
6+
branches-ignore:
7+
- main
68

79
jobs:
810
dev:
@@ -30,16 +32,17 @@ jobs:
3032
username: ${{ secrets.DOCKERHUB_USERNAME }}
3133
password: ${{ secrets.DOCKERHUB_TOKEN }}
3234

33-
- name: Build and Push Image to Docker Hub
34-
uses: docker/build-push-action@v5
35-
with:
36-
push: true
37-
tags: |
38-
${{ secrets.DOCKERHUB_REPO }}/${{ secrets.DOCKERHUB_IMG }}:latest
39-
cache-from: type=local,src=/tmp/.buildx-cache
40-
cache-to: type=local,dest=/tmp/.buildx-cache-new
41-
42-
- name: Move Cache
35+
- name: Set environment variables
4336
run: |
44-
rm -rf /tmp/.buildx-cache
45-
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
37+
echo "DOCKERHUB_REPO=${{ secrets.DOCKERHUB_REPO }}" >> $GITHUB_ENV
38+
echo "DOCKERHUB_IMG=${{ secrets.DOCKERHUB_IMG }}" >> $GITHUB_ENV
39+
echo "HUGGINGFACE_ACCESS_TOKEN=${{ secrets.HUGGINGFACE_ACCESS_TOKEN }}" >> $GITHUB_ENV
40+
41+
- name: Build and push the images to Docker Hub
42+
uses: docker/bake-action@v2
43+
with:
44+
push: true
45+
set: |
46+
*.args.DOCKERHUB_REPO=${{ env.DOCKERHUB_REPO }}
47+
*.args.DOCKERHUB_IMG=${{ env.DOCKERHUB_IMG }}
48+
*.args.HUGGINGFACE_ACCESS_TOKEN=${{ env.HUGGINGFACE_ACCESS_TOKEN }}

0 commit comments

Comments
 (0)