44 lines
1.2 KiB
YAML
44 lines
1.2 KiB
YAML
name: Build the docker base image weekly
|
|
# on: [push]
|
|
|
|
on:
|
|
push:
|
|
# branches:
|
|
# - main
|
|
schedule:
|
|
- cron: "0 6 * * 5" #Every Friday@11:30 AM IST (6:00 GMT)
|
|
# Cron: Minute(0-59) Hour(0-23) DayOfMonth(1-31) MonthOfYear(1-12) DayOfWeek(0-6)
|
|
|
|
env:
|
|
DOCKER_REGISTRY: ${{ vars.docker_repo2_registry }}
|
|
REPO: ${{ github.repository }}
|
|
DOCKER_IMAGE: ${{ vars.docker_repo2_registry }}/${{ github.repository }}:base-v2
|
|
|
|
jobs:
|
|
|
|
docker-build-and-push:
|
|
runs-on: ubuntu-22.04 #ubuntu-latest
|
|
# if: ${{ github.event_name == 'push' }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Login to Docker Container Registry
|
|
# if: ${{ github.event_name == 'push' }}
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ vars.docker_repo2_registry }}
|
|
username: ${{ vars.docker_repo2_username }}
|
|
password: ${{ vars.docker_repo2_password }}
|
|
|
|
- name: Build the Base Docker image
|
|
run: |
|
|
docker build \
|
|
--file fab/d/actions-base.Dockerfile \
|
|
--tag $DOCKER_IMAGE \
|
|
./fab/context/;
|
|
|
|
- name: Push the Docker image
|
|
# if: ${{ github.event_name == 'push' }}
|
|
run: |
|
|
docker push $DOCKER_IMAGE
|