Skip to content

Commit

Permalink
Merge pull request #22 from daithihearn/pipelines
Browse files Browse the repository at this point in the history
chore: adding deployment pipelines
  • Loading branch information
daithihearn authored Jan 25, 2024
2 parents f04397c + 5d613d4 commit aa60188
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Build Docker image

on:
workflow_dispatch:
pull_request:
branches: ["main"]

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

steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build . --file Dockerfile
19 changes: 19 additions & 0 deletions .github/workflows/deploy-to-heroku.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Deploy to Heroku

on:
release:
types: [ published ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Deploy to Heroku
uses: akhileshns/[email protected]
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: ${{ secrets.HEROKU_APP_NAME }}
heroku_email: ${{ secrets.EMAIL }}
29 changes: 29 additions & 0 deletions .github/workflows/publish-to-dockerhub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Publish to Dockerhub

on:
release:
types: [published]

jobs:
publish:
name: Build and Publish docker image to dockerhub
permissions:
contents: write
pull-requests: write
packages: read
runs-on: ubuntu-latest

steps:
- name: Login to Dockerhub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and publish Docker image
run: |
docker buildx build --platform linux/amd64,linux/arm64/v8 -t daithihearn/cards-110-api:latest -t daithihearn/cards-110-api:${{ github.ref_name }} --push .

0 comments on commit aa60188

Please sign in to comment.