PromucFlow_constructor/.github/workflows/docker-base-image.yml
Arpit Mohan 2650ea161d
ci: Updating actions/checkout to v4 and defaulting to fetch-depth 1 instead of 0 (#29281)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Chores**
- Updated GitHub Actions workflows to use `actions/checkout@v4` for
improved performance and reliability.
- Removed `fetch-depth` parameter to simplify checkout steps across
various workflows.
  - Standardized quote usage for consistency in workflow files.

- **Documentation**
- Adjusted formatting and descriptions in workflow files for better
clarity and readability.

- **Refactor**
- Aligned multiple workflow files to follow a consistent structure and
naming convention.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

fetch-depth 0 causes the Github workflow to checkout the entire Git
history. This is not required. We only need to check out the head of the
commit. By default, actions/checkout has fetch-depth=1, hence removing
it from the workflow completely for simplicity.
2023-12-05 13:44:43 +05:30

56 lines
1.3 KiB
YAML

name: Docker Base Image
on:
workflow_dispatch:
schedule:
- cron: "0 5 * * MON"
push:
branches:
- release
- master
paths:
- "deploy/docker/base.dockerfile"
jobs:
build-docker:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout the head commit of the branch
uses: actions/checkout@v4
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Get tag
id: tag
run: |
tag="${GITHUB_REF_NAME//\//-}"
if [[ "$tag" == master ]]; then
tag=nightly
fi
echo "tag=$tag" >> "$GITHUB_OUTPUT"
- name: Build and push base image
uses: docker/build-push-action@v5
with:
context: .
file: deploy/docker/base.dockerfile
push: true
platforms: linux/arm64,linux/amd64
tags: |
${{ vars.DOCKER_HUB_ORGANIZATION }}/base-${{ vars.EDITION }}:${{ steps.tag.outputs.tag }}