Skip to content

docker-build

docker-build #1007

Workflow file for this run

name: docker-build
on:
schedule:
- cron: "0 10 * * *"
push:
branches:
- main
tags:
- '*'
workflow_dispatch:
inputs:
build_only:
type: boolean
description: 'Only build the image, no push'
required: false
default: false
jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for existing website-base image for current branch
if: "${{ !startsWith(github.ref, 'refs/tags/v') }}"
id: existing-image
run: |
if docker pull geokrety/website-base:${{ github.ref_name }}; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi
- name: Override base image tag from branch name
if: "${{ !startsWith(github.ref, 'refs/tags/v') && steps.existing-image.outputs.exists == 'true' }}"
run: |
sed -i "s/^ARG BASE_TAG=.*$/ARG BASE_TAG=${{ github.ref_name }}/" Dockerfile
- uses: geokrety/geokrety-gha-workflows/.github/actions/docker-build@main
with:
image_name: geokrety/website
dockerhub_username: ${{ vars.DOCKERHUB_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
push: ${{ inputs.build_only == 'false' || true }}
update-version-set:
uses: geokrety/geokrety-gha-workflows/.github/workflows/version-set.yml@main
needs: docker
secrets:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
deploy:
uses: geokrety/geokrety-gha-workflows/.github/workflows/trigger-staging-deploy.yml@main
needs: docker
secrets:
DEPLOY_HEADER_NAME: ${{ secrets.DEPLOY_HEADER_NAME }}
DEPLOY_HEADER_VALUE: ${{ secrets.DEPLOY_HEADER_VALUE }}
DEPLOY_URL: ${{ secrets.DEPLOY_URL }}