mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-18 22:44:24 +01:00
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
This commit is contained in:
59
.github/workflows/docker-build.yml
vendored
Normal file
59
.github/workflows/docker-build.yml
vendored
Normal file
@@ -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
|
||||||
Reference in New Issue
Block a user