Skip to content

Defines comma value so reference works #23

Defines comma value so reference works

Defines comma value so reference works #23

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
steps:
- name: Clone this git repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Docker meta
if: github.event_name != 'pull_request'
id: meta
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804
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/v0.') }}
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772
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@74a5d142397b4f367a81961eba4e8cd7edddf772
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2
- name: Build and export
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1
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@14487ce63c7a62a4a324b0bfb37086795e31c6c1
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
secrets: |
"GITHUB_ACCESS_TOKEN=${{ secrets.GH_READONLY_TOKEN }}"