Merge pull request #5 from Jinnan-Guo/dm-verity-crypt #4
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: Push SKR Debug Image | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- .github/workflows/push_skr_debug_image.yml | |
- cmd/skr/** | |
- docker/skr/** | |
- tools/get-snp-report/** | |
- vendor/** | |
- internal/** | |
- pkg/** | |
push: | |
branches: | |
- main | |
paths: | |
- .github/workflows/push_skr_debug_image.yml | |
- cmd/skr/** | |
- docker/skr/** | |
- tools/get-snp-report/** | |
- vendor/** | |
- internal/** | |
- pkg/** | |
jobs: | |
push-skr-debug-image: | |
name: Push SKR Debug Image | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Log in to Azure Container Registry | |
run: | | |
az acr login \ | |
--name ${{ secrets.REGISTRY_NAME }} \ | |
--username ${{ secrets.REGISTRY_NAME }} \ | |
--password ${{ secrets.REGISTRY_PASSWORD }} | |
- name: Build Image | |
run: docker/skr/build-debug.sh | |
- name: Push Image | |
run: | | |
if [ ${{ github.event_name }} == "push" ]; then | |
branch_name=main | |
elif [ ${{ github.event_name }} == "workflow_dispatch" ]; then | |
branch_name=${{ github.ref }} | |
branch_name=${branch_name:11} | |
else | |
branch_name=${{ github.head_ref }} | |
fi | |
image_tag=$(echo ${branch_name:0:128} | sed 's/[^a-zA-Z0-9]/-/g') | |
docker/skr/push.sh \ | |
${{ secrets.REGISTRY_NAME }} \ | |
${{ secrets.REGISTRY_DOMAIN }} \ | |
skr_debug:$image_tag \ | |
--skip-login |