README.md created. #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Web | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build_and_push: | |
name: Build and Push | |
runs-on: ubuntu-latest | |
environment: Production | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Git Checkout | |
uses: actions/checkout@v4 | |
- name: Login to Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GH_TOKEN }} | |
- name: Build and push API | |
uses: docker/build-push-action@v5 | |
with: | |
build-args: GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} | |
file: Dockerfile | |
push: true | |
tags: ghcr.io/rsametsamyeli/samyeli-dev:latest | |
deploy: | |
name: Deploy to Dokku | |
runs-on: ubuntu-latest | |
needs: build_and_push | |
environment: Production | |
steps: | |
- name: Deploy to Dokku | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ vars.HOST_IP }} | |
username: root | |
key: ${{ secrets.HOST_SSH_KEY }} | |
script: | | |
docker pull ghcr.io/rsametsamyeli/samyeli-dev:latest | |
dokku ps:rebuild samyeli.dev | |
yes | docker image prune --filter="label=app=samyeli.dev" |