Skip to content

Commit

Permalink
Merge pull request #698 from hngprojects/team-deploy
Browse files Browse the repository at this point in the history
Team deploy
  • Loading branch information
ThePrimeJnr authored Jul 28, 2024
2 parents 2ffcd9e + deb1c28 commit 937fcbe
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 21 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build and Push

on:
push:
branches:
- dev

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
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.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v6
with:
context: ./docker/development/Dockerfile
push: true
tags: hngdevops/nextjs-boilerplate:dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI Build, Lint, and Test
name: Build, Lint, and Test

on:
pull_request
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Coverage Report

on:
workflow_run:
workflows: ["CI Build, Lint, and Test"]
workflows: ["Build, Lint, and Test"]
types:
- completed

Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/dev-deployment.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: Dev Deployment

on:
push:
branches:
- dev
paths-ignore:
- .github/workflows/**
workflow_run:
workflows: ["Build and Push"]
types:
- completed

jobs:
deploy_to_dev:
Expand Down
23 changes: 9 additions & 14 deletions .github/workflows/team-deployment.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: Team Deployment

on:
push:
branches:
- team-deploy
paths-ignore:
- .github/workflows/**
workflow_run:
workflows: ["Build and Push"]
types:
- completed

jobs:
team_deployment:
Expand All @@ -17,14 +16,10 @@ jobs:

environment:
name: ${{ matrix.environment }}
url: ${{ secrets.URL }}

steps:
- name: Deploy to ${{ matrix.environment }} environment
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
./deploy_${{ matrix.environment }}.sh
- name: Checkout code
uses: actions/checkout@v3

- name: Print Environment
run: echo "Current environment is ${{ matrix.environment }}"

0 comments on commit 937fcbe

Please sign in to comment.