Pls
This commit is contained in:
parent
788ea433c3
commit
7915a9e9c7
2 changed files with 28 additions and 21 deletions
47
.github/workflows/deploy.yml
vendored
47
.github/workflows/deploy.yml
vendored
|
@ -1,35 +1,42 @@
|
|||
name: Build and Push Docker Image to DO Container Registry
|
||||
name: Build and Push Multi-Arch Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Build the Docker image
|
||||
run: docker build . --file Dockerfile --tag ${{ github.event.repository.name }}:${{ github.sha }}
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Install doctl
|
||||
uses: digitalocean/action-doctl@v2
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v2
|
||||
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 ${{ github.event.repository.name }}:${{ github.sha }} ${{ secrets.DIGITALOCEAN_REGISTRY }}/${{ github.event.repository.name }}:${{ github.sha }}
|
||||
docker tag ${{ github.event.repository.name }}:${{ github.sha }} ${{ secrets.DIGITALOCEAN_REGISTRY }}/${{ github.event.repository.name }}:latest
|
||||
|
||||
- name: Push images to DO Container Registry
|
||||
run: |
|
||||
docker push ${{ secrets.DIGITALOCEAN_REGISTRY }}/${{ github.event.repository.name }}:${{ github.sha }}
|
||||
docker push ${{ secrets.DIGITALOCEAN_REGISTRY }}/${{ github.event.repository.name }}:latest
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: |
|
||||
ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}
|
||||
ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
services:
|
||||
app:
|
||||
image: registry.digitalocean.com/himboreg/pollo:latest
|
||||
image: ghcr.io/atridadl/pollo:latest
|
||||
command: ["/app"]
|
||||
depends_on:
|
||||
db:
|
||||
|
|
Loading…
Add table
Reference in a new issue