Template
1
0
Fork 0
This commit is contained in:
Atridad Lahiji 2024-09-20 01:04:01 -06:00
parent 47364b586f
commit b100ed0b09
Signed by: atridad
SSH key fingerprint: SHA256:LGomp8Opq0jz+7kbwNcdfTcuaLRb5Nh0k5AchDDb438

30
.github/workflows/docker.yml vendored Normal file
View file

@ -0,0 +1,30 @@
name: Build and Push Docker Image
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build . --file Dockerfile --tag atridad:${{ github.sha }}
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Log in to DO Container Registry
run: doctl registry login --expiry-seconds 600
- name: Tag image
run: docker tag atridad:${{ github.sha }} registry.digitalocean.com/<your-registry-name>/atridad:${{ github.sha }}
- name: Push image to DO Container Registry
run: docker push registry.digitalocean.com/<your-registry-name>/atridad:${{ github.sha }}