Skip to content

Commit

Permalink
chore: update docker push workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rajdip-b committed Feb 2, 2024
1 parent 593f3ea commit 680fbd5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 54 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/docker-build-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
on:
push:
branches:
- main
- alpha
tags:
- '*'

jobs:
build-web:
runs-on: ubuntu-latest
name: Build and push docker image

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build Docker image
run: docker build -t keyshade/keyshade-web:${{ github.ref_name }} -f ./apps/web/Dockerfile .

- name: Push Docker image
run: docker push keyshade/keyshade-web
54 changes: 0 additions & 54 deletions .github/workflows/web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,57 +50,3 @@ jobs:
- name: Test
run: |
pnpm run test:web
build-alpha:
needs: validate
if: ${{ github.ref == 'refs/tags/v*.*.*-alpha' && github.event_name == 'push' }}
runs-on: ubuntu-latest
name: Build and push docker image

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build Docker image
run: docker build -t keyshade/keyshade-web:${{ github.ref_name }}-alpha -f ./apps/web/Dockerfile .

- name: Push Docker image
run: docker push keyshade/keyshade-web

build-release:
needs: validate
if: ${{ github.ref == 'refs/tags/v*.*.*' && github.event_name == 'push' }}
runs-on: ubuntu-latest
name: Build and push docker image

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build Docker image
run: docker build -t keyshade/keyshade-web:latest -t keyshade/keyshade-web:${{ github.ref_name }} -f ./apps/web/Dockerfile .

- name: Push Docker image
run: docker push keyshade/keyshade-web

deploy:
needs: build-release
if: ${{ github.ref == 'refs/tags/v*.*.*' && github.event_name == 'push' }}
runs-on: ubuntu-latest
name: Deploy to Render

steps:
- name: deploy
run: curl ${{ secrets.RENDER_WEB_DEPLOY_HOOK }}

0 comments on commit 680fbd5

Please sign in to comment.