Skip to content

Merge pull request #115 from qtomlinson/qt/retry #46

Merge pull request #115 from qtomlinson/qt/retry

Merge pull request #115 from qtomlinson/qt/retry #46

name: Build and publish ClearlyDefined backup-data Docker image
on:
workflow_dispatch:
push:
branches: [main]
env:
DOCKER_IMAGE_NAME: ghcr.io/${{ github.repository }}/backup-data
DOCKER_IMAGE_TAG: ghcr.io/${{ github.repository }}/backup-data:${{ github.sha }}
jobs:
publish_backup_data_docker_image:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./tools/blobstorage-backupdata
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Run tests
run: dotnet test
- name: Check Docker Version
run: docker --version
- name: Login to ghcr.io
run: |
echo "********** logging in to Docker for ghcr.io"
docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
- name: Build docker image
run: |
echo "********** building ${{env.DOCKER_IMAGE_NAME}} image"
echo "********** cmd: docker build --tag ${{ env.DOCKER_IMAGE_TAG }} ."
docker build --tag ${{ env.DOCKER_IMAGE_TAG }} .
- name: Push to ghcr.io
run: |
echo "********** pushing Docker image to ghcr.io"
echo "********** cmd: docker push ${{ env.DOCKER_IMAGE_TAG }}"
docker push ${{ env.DOCKER_IMAGE_TAG }}