Template
1
0
Fork 0

Github Repo

This commit is contained in:
Atridad Lahiji 2024-09-20 21:58:15 -06:00
parent 93b7b9ed68
commit e063a906d2
Signed by: atridad
SSH key fingerprint: SHA256:LGomp8Opq0jz+7kbwNcdfTcuaLRb5Nh0k5AchDDb438
2 changed files with 16 additions and 25 deletions

View file

@ -12,23 +12,21 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build . --file Dockerfile --tag atridad:${{ github.sha }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Install doctl
uses: digitalocean/action-doctl@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to DO Container Registry
run: doctl registry login --expiry-seconds 600
- name: Tag images
run: |
docker tag atridad:${{ github.sha }} ${{ secrets.DIGITALOCEAN_REGISTRY }}:${{ github.sha }}
docker tag atridad:${{ github.sha }} ${{ secrets.DIGITALOCEAN_REGISTRY }}:latest
- name: Push images to DO Container Registry
run: |
docker push ${{ secrets.DIGITALOCEAN_REGISTRY }}:${{ github.sha }}
docker push ${{ secrets.DIGITALOCEAN_REGISTRY }}:latest
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ github.sha }}
ghcr.io/${{ github.repository }}:latest

View file

@ -1,13 +1,6 @@
services:
app:
image: registry.digitalocean.com/himboapps/atridotdad:latest
image: ghcr.io/atridadl/atridotdad:latest
command: ["/app"]
ports:
- "3000:3000"
networks:
- proxy
networks:
proxy:
name: proxy
external: true