Skip to content

Commit 1d9fab3

Browse files
committed
add permissions and docker build and push job
1 parent 2b7a269 commit 1d9fab3

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

.github/workflows/deploy-ui.yml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
- main
66
workflow_dispatch:
77

8+
permissions:
9+
contents: write
10+
deployments: write
11+
812
jobs:
913
deploy-production:
1014
name: Deploy (Production)
@@ -34,4 +38,34 @@ jobs:
3438
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
3539

3640
- name: Deploy Project Artifacts to Vercel
37-
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
41+
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
42+
43+
44+
docker-deploy:
45+
name: Build and Push Docker Image
46+
runs-on: ubuntu-latest
47+
environment:
48+
name: docker_hub
49+
50+
steps:
51+
- name: Checkout code
52+
uses: actions/checkout@v4
53+
54+
- name: Login to Docker Hub
55+
uses: docker/login-action@v3
56+
with:
57+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
58+
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
59+
60+
- name: Set up Docker Buildx
61+
id: buildx
62+
uses: docker/setup-buildx-action@v3
63+
64+
- name: Build and push image to Docker Hub
65+
uses: docker/build-push-action@v5
66+
with:
67+
builder: ${{ steps.buildx.outputs.name }}
68+
context: "{{defaultContext}}:frontend"
69+
file: Dockerfile.prod
70+
push: true
71+
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/taskaza-ui:${{ github.sha }}

0 commit comments

Comments
 (0)