Tag image also with OpenShift version #32
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
on: | |
workflow_dispatch: # Manually trigger the workflow | |
push: | |
branches: | |
- main | |
pull_request: | |
schedule: | |
# Weekly on Sunday at 06:00 UTC | |
- cron: '0 6 * * 1' | |
jobs: | |
build: | |
name: Building Docker Image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/#-action@v3 | |
if: github.event_name != 'pull_request' | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Get latest git tag | |
id: git_tag | |
run: echo ::set-output name=tag::$(git describe --tags --abbrev=0) | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: tyrola/openshift-homelab:latest,tyrola/openshift-homelab:${{ steps.git_tag.outputs.tag }} | |
context: docker/ | |
platforms: linux/amd64 |