Skip to content

Updates mockstack/clean with explicit format for docker/podman compatiblity #454

Updates mockstack/clean with explicit format for docker/podman compatiblity

Updates mockstack/clean with explicit format for docker/podman compatiblity #454

Workflow file for this run

name: Build, test, and publish container image
on:
# Run pull requests against the default branch
pull_request:
branches: [master]
# Run on push to default branch
push:
branches: [master]
# Run when a release is created
release:
types: [released]
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Clone this git repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Docker meta
if: github.event_name != 'pull_request'
id: meta
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051
with:
# list of Docker images to use as base name for tags
images: |
plus3it/tardigrade-ci
ghcr.io/plus3it/tardigrade-ci
flavor: |
latest=false
# generate Docker tags based on the following events/attributes
tags: |
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
# set version tags for releases
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/0.') }}
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f
- name: Build and export
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8
with:
context: .
load: true
tags: plus3it/tardigrade-ci:test
secrets: |
"GITHUB_ACCESS_TOKEN=${{ secrets.GITHUB_TOKEN }}"
- name: Run bats tests
if: github.event_name == 'pull_request'
run: docker run --rm -e "GITHUB_ACCESS_TOKEN=${{ secrets.GITHUB_TOKEN }}" plus3it/tardigrade-ci:test bats/test
- name: Push to registries
if: github.event_name != 'pull_request'
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
secrets: |
"GITHUB_ACCESS_TOKEN=${{ secrets.GH_READONLY_TOKEN }}"