Update README.md #26
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: Build and Push Python app Image | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install Podman | |
run: | | |
sudo apt update | |
sudo apt install -y podman | |
- name: Build and push Podman image | |
env: | |
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }} | |
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }} | |
QUAY_URL: ${{ secrets.QUAY_URL }} | |
QUAY_REPOSITORY: ${{ secrets.QUAY_REPOSITORY }} | |
run: | | |
COMMIT_HASH=$(git rev-parse --short HEAD) | |
TAG=$(echo $GITHUB_REF | sed 's|.*/||') | |
IMAGE_NAME=$QUAY_URL/$QUAY_REPOSITORY/sigstore-app:$TAG | |
podman build -t $IMAGE_NAME . | |
podman login -u $QUAY_USERNAME -p $QUAY_PASSWORD $QUAY_URL | |
podman tag $IMAGE_NAME $QUAY_URL/$QUAY_REPOSITORY/sigstore-app:$COMMIT_HASH | |
podman push $IMAGE_NAME | |
podman push $QUAY_URL/$QUAY_REPOSITORY/sigstore-app:$COMMIT_HASH |