Skip to content

Suppress Spurious 'Invalid File' Warnings #18

Suppress Spurious 'Invalid File' Warnings

Suppress Spurious 'Invalid File' Warnings #18

Workflow file for this run

name: Build and publish the production container image to the GitHub Registry
# Run this workflow when new releases are created
on:
release:
types: [published]
env:
IMAGE_NAME: imap-backup
REGISTRY_USER: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ github.token }}
REGISTRY: ghcr.io/${{ github.repository_owner }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get the latest tag
run: |
echo "GIT_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_ENV
- name: Build Image
# https://github.com/marketplace/actions/buildah-build
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: latest ${{ github.sha }} ${{ env.GIT_TAG }}
extra-args: |
--ignorefile ./container/.containerignore
containerfiles: |
./container/Containerfile
labels: |
${{ env.IMAGE_NAME }}:latest
# Check that imap-backup runs
- name: Test Image
run: podman run ${{ env.IMAGE_NAME }}:latest imap-backup help | grep 'Commands:'
- name: Publish Image
# https://github.com/marketplace/actions/push-to-registry
id: push-to-registry
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ${{ env.REGISTRY }}
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}