Skip to content

Commit

Permalink
Add a Github Actions job to publish Docker images to Dockerhub and gh…
Browse files Browse the repository at this point in the history
…cr (CTFd#2027)

* Add a Github Actions job to publish Docker images to Dockerhub and ghcr
* Closes CTFd#1982
  • Loading branch information
ColdHeat authored Nov 23, 2021
1 parent cf743a2 commit a9aa0ca
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a9aa0ca

Please sign in to comment.