From a9aa0cab61dcd9eaaa22f92ef5eb185f10f74745 Mon Sep 17 00:00:00 2001 From: Kevin Chung Date: Mon, 22 Nov 2021 19:27:26 -0500 Subject: [PATCH] Add a Github Actions job to publish Docker images to Dockerhub and ghcr (#2027) * Add a Github Actions job to publish Docker images to Dockerhub and ghcr * Closes #1982 --- .github/workflows/docker-build.yml | 59 ++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/docker-build.yml diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 00000000..6a4fc684 --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,59 @@ +name: Docker build image on release + +# on: +# release: +# types: [published] + +on: + push: + branches: + - 'master' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v2 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + # - + # name: Build and push + # uses: docker/build-push-action@v2 + # with: + # context: . + # platforms: linux/amd64 + # push: true + # tags: | + # ctfd/ctfd:latest + # ghcr.io/ctfd/ctfd:latest + # ctfd/ctfd:${{ github.event.release.tag_name }} + # ghcr.io/ctfd/ctfd:${{ github.event.release.tag_name }} + - + name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/amd64 + push: true + tags: | + ctfd/ctfd:test-github-action + ghcr.io/ctfd/ctfd:test-github-action \ No newline at end of file