Build and push docker images #640
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and push docker images | |
on: | |
schedule: | |
- cron: "0 3 * * *" | |
workflow_dispatch: | |
jobs: | |
get_base_tags: | |
runs-on: ubuntu-latest | |
outputs: | |
tags: ${{ steps.get-base-tags.outputs.tags }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get base tags | |
id: get-base-tags | |
run: | | |
tags=$(./get_base_tags.sh --json) | |
echo "tags=$tags" >> $GITHUB_OUTPUT | |
build_push: | |
runs-on: ubuntu-latest | |
needs: get_base_tags | |
# Dynamically generate a job for each tag we found in step before | |
strategy: | |
matrix: | |
tag: ${{ fromJson(needs.get_base_tags.outputs.tags) }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push ${{ matrix.tag }} | |
run: ./build.sh --build --push --base-tag ${{ matrix.tag }} |