Added datetime tag for auto build #10
Workflow file for this run
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 publish a Docker image to Github Packages | |
on: | |
push: | |
tags: | |
- '*' | |
#branches: | |
# - release | |
jobs: | |
build-and-push-image: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Echo the branch name | |
run: | | |
echo "Tag name from github.ref_name: ${{ github.ref_name }}" | |
- name: Build and push Docker image | |
run: | | |
echo "::set-env name=TIME_TAG::$(date +'%Y%m%d.%H%M%S')" | |
docker login --username scadaguru --password ${{ secrets.GHCR_TOKEN }} ghcr.io | |
docker build . -t ghcr.io/scadaguru/test-auto-docker-build:${{ github.ref_name }} -t ghcr.io/scadaguru/test-auto-docker-build:v${{ env.TIME_TAG }} -t ghcr.io/scadaguru/test-auto-docker-build | |
docker push ghcr.io/scadaguru/test-auto-docker-build:${{ github.ref_name }} | |
docker push ghcr.io/scadaguru/test-auto-docker-build:v${{ env.TIME_TAG }} | |
docker push ghcr.io/scadaguru/test-auto-docker-build |