Github Repo
This commit is contained in:
parent
40048328ca
commit
d03482270f
1 changed files with 27 additions and 19 deletions
46
.github/workflows/docker.yml
vendored
46
.github/workflows/docker.yml
vendored
|
@ -1,4 +1,4 @@
|
||||||
name: Build and Push Docker Image
|
name: Build and Push Multi-Arch Docker Image
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
@ -9,26 +9,34 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Build the Docker image
|
- name: Set up QEMU
|
||||||
run: docker build . --file Dockerfile --tag atridad:${{ github.sha }}
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
- name: Install doctl
|
- name: Set up Docker Buildx
|
||||||
uses: digitalocean/action-doctl@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Log in to DO Container Registry
|
- name: Build and push
|
||||||
run: doctl registry login --expiry-seconds 600
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
- name: Tag images
|
context: .
|
||||||
run: |
|
platforms: linux/amd64,linux/arm64
|
||||||
docker tag atridad:${{ github.sha }} ${{ secrets.DIGITALOCEAN_REGISTRY }}:${{ github.sha }}
|
push: true
|
||||||
docker tag atridad:${{ github.sha }} ${{ secrets.DIGITALOCEAN_REGISTRY }}:latest
|
tags: |
|
||||||
|
ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}
|
||||||
- name: Push images to DO Container Registry
|
ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest
|
||||||
run: |
|
|
||||||
docker push ${{ secrets.DIGITALOCEAN_REGISTRY }}:${{ github.sha }}
|
|
||||||
docker push ${{ secrets.DIGITALOCEAN_REGISTRY }}:latest
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue