Skip to content
name: Build and publish a Docker image to Github Packages
on:
push:
#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: |
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
docker push ghcr.io/scadaguru/test-auto-docker-build:${{ github.ref_name }}
docker push ghcr.io/scadaguru/test-auto-docker-build