Skip to content

Commit

Permalink
Create docker image deploy action
Browse files Browse the repository at this point in the history
  • Loading branch information
gjonhajdari authored Oct 18, 2024
1 parent 7505432 commit 41cd5ce
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/deploy-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build, Push and Deploy a Docker Image

on:
push:
branches: [main]

jobs:
build-push-deploy-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v6.5.0
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}:latest
- name: Deploy the app
uses: digitalocean/app_action/deploy@v2
env:
SAMPLE_DIGEST: ${{ steps.push.outputs.digest }}
with:
token: ${{ secrets.YOUR_DIGITALOCEAN_ACCESS_TOKEN_VARIABLE_NAME }}

0 comments on commit 41cd5ce

Please sign in to comment.