diff --git a/.github/workflows/docker-build-and-push.yml b/.github/workflows/docker-build-and-push.yml new file mode 100644 index 00000000..2a0955cd --- /dev/null +++ b/.github/workflows/docker-build-and-push.yml @@ -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 diff --git a/.github/workflows/web.yaml b/.github/workflows/web.yaml index d054b5e6..41be3c19 100644 --- a/.github/workflows/web.yaml +++ b/.github/workflows/web.yaml @@ -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 }}