Update Docker Image CI/CD (#2183)

* Update docker-build.yml to provide ARM builds
This commit is contained in:
Brendan McShane
2022-09-15 16:24:58 -04:00
committed by GitHub
parent 4793d95338
commit 04de6c0b4f

View File

@@ -7,38 +7,40 @@ on:
jobs: jobs:
docker: docker:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps: steps:
- - name: Set repo name lowercase
name: Checkout id: repo
uses: actions/checkout@v2 uses: ASzc/change-string-case-action@v2
- with:
name: Set up QEMU string: ${{ github.repository }}
uses: docker/setup-qemu-action@v1 - name: Checkout
- uses: actions/checkout@v3
name: Set up Docker Buildx - name: Set up QEMU
uses: docker/setup-buildx-action@v1 uses: docker/setup-qemu-action@v2
- - name: Set up Docker Buildx
name: Login to DockerHub uses: docker/setup-buildx-action@v2
uses: docker/login-action@v1 - name: Login to DockerHub
uses: docker/login-action@v2
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- - name: Login to GitHub Container Registry
name: Login to GitHub Container Registry uses: docker/login-action@v2
uses: docker/login-action@v1
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.repository_owner }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- - name: Build and push
name: Build and push uses: docker/build-push-action@v3
uses: docker/build-push-action@v2
with: with:
context: . context: .
platforms: linux/amd64 platforms: linux/amd64,linux/arm64
push: true push: true
tags: | tags: |
ctfd/ctfd:latest ${{ steps.repo.outputs.lowercase }}:latest
ghcr.io/ctfd/ctfd:latest ghcr.io/${{ steps.repo.outputs.lowercase }}:latest
ctfd/ctfd:${{ github.event.release.tag_name }} ${{ steps.repo.outputs.lowercase }}:${{ github.event.release.tag_name }}
ghcr.io/ctfd/ctfd:${{ github.event.release.tag_name }} ghcr.io/${{ steps.repo.outputs.lowercase }}:${{ github.event.release.tag_name }}