Skip to content

Commit

Permalink
Push to Dokku
Browse files Browse the repository at this point in the history
  • Loading branch information
justinh-rahb authored Feb 28, 2024
1 parent 16c68da commit ed40da0
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
env:
REGISTRY: ghcr.io
IMAGE_NAME: rahb-realtors-association/selenium-screenshots
DOKKU_APP_NAME: screenshot-api
DOKKU_REMOTE_URL: ssh://[email protected]:22/screenshot-api

jobs:
build-and-push-image:
Expand Down Expand Up @@ -45,3 +47,30 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

deploy-to-dokku:
needs: build-and-push-image
runs-on: ubuntu-latest
permissions:
contents: none
packages: none

steps:
- name: Download Docker image
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Use the Git reference (branch or tag) as the Docker tag.
tag: ${{ steps.meta.outputs.tags }}
id: download-image

- name: Deploy to Dokku
uses: dokku/[email protected]
with:
git_remote_url: ${{ env.DOKKU_REMOTE_URL }}
ci_branch_name: github.ref
ci_commit: ${{ steps.build-and-push-image.outputs.sha }}
ssh_private_key: ${{ secrets.DOKKU_SSH_PRIVATE_KEY }}
deploy_docker_image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.download-image.outputs.tag }}

0 comments on commit ed40da0

Please sign in to comment.