From 47482e0517b407a4eb529a5a942c5a5a6cf8e164 Mon Sep 17 00:00:00 2001 From: Tarashish Mishra Date: Mon, 16 Oct 2023 14:16:57 +0530 Subject: [PATCH] Publish docker image to GHCR refs https://github.com/developmentseed/osmcha-migration-internal/issues/3 --- .github/workflows/docker-publish.yml | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/docker-publish.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 00000000..2d7e0efc --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,35 @@ +name: Build Docker Image, Push to GHCR + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: ./compose/django + push: true + tags: | + ghcr.io/willemarcel/osmcha-django:latest + ghcr.io/willemarcel/osmcha-django:${{ github.sha }} + cache-from: type=gha + cache-to: type=gha,mode=max \ No newline at end of file