-
Notifications
You must be signed in to change notification settings - Fork 11
44 lines (37 loc) · 1.32 KB
/
backup-data-docker-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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 }}