Build transfer image #89
This file contains hidden or 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 transfer image | |
| on: | |
| schedule: | |
| - cron: '0 0 * * 5' # Runs at 00:00 every Friday | |
| workflow_dispatch: | |
| inputs: | |
| publish: | |
| description: "Publish transfer image with binaries to ghcr.io/netcracker/site-manager-transfer" | |
| type: boolean | |
| default: false | |
| required: false | |
| jobs: | |
| build-docker-transfer: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Archive bare repository | |
| run: | | |
| git clone --bare https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/Netcracker/DRNavigator | |
| zip -r repository.zip DRNavigator.git | |
| - name: Build Docker Image for site-manager-transfer | |
| run: docker build -t site-manager-transfer -f ci/docker-transfer/Dockerfile --no-cache . | |
| - name: Publish to ghcr.io | |
| if: github.ref_name == 'main' || inputs.publish | |
| run: | | |
| GHCRIO_TAG=$(echo "${{ github.ref_name }}" | sed 's/\//_/g') | |
| GHCRIO_IMAGE=ghcr.io/netcracker/site-manager-transfer:$GHCRIO_TAG | |
| docker tag site-manager-transfer $GHCRIO_IMAGE | |
| echo -e "\033[0;32mPushing image ${GHCRIO_IMAGE}\033[0m" | |
| echo ${{ secrets.GITHUB_TOKEN }} | docker login https://ghcr.io -u $GITHUB_ACTOR --password-stdin | |
| docker push $GHCRIO_IMAGE |