docs: clarify Saizeriya CLI command risk categories (#24) #14
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: Publish betterzeriya container | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version to publish, for example 0.1.0' | |
| required: true | |
| type: string | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Validate version | |
| if: github.event_name == 'workflow_dispatch' | |
| run: | | |
| if ! node -e "process.exit(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/.test(process.env.VERSION) ? 0 : 1)"; then | |
| echo "Invalid version: ${VERSION}. Use x.x.x, for example 0.1.0." >&2 | |
| exit 1 | |
| fi | |
| env: | |
| VERSION: ${{ inputs.version }} | |
| - name: Prepare image metadata | |
| id: meta | |
| run: | | |
| IMAGE="ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/betterzeriya" | |
| echo "image=$IMAGE" >> "$GITHUB_OUTPUT" | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| VERSION="${{ inputs.version }}" | |
| { | |
| echo "tags<<EOF" | |
| echo "$IMAGE:$VERSION" | |
| echo "$IMAGE:latest" | |
| echo "EOF" | |
| echo "version=$VERSION" | |
| } >> "$GITHUB_OUTPUT" | |
| else | |
| VERSION="sha-${GITHUB_SHA}" | |
| { | |
| echo "tags<<EOF" | |
| echo "$IMAGE:$VERSION" | |
| echo "$IMAGE:latest" | |
| echo "EOF" | |
| echo "version=$VERSION" | |
| } >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ github.token }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and publish | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: apps/betterzeriya/Dockerfile | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: | | |
| org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} | |
| org.opencontainers.image.revision=${{ github.sha }} | |
| org.opencontainers.image.version=${{ steps.meta.outputs.version }} |