Skip to content

v0.5.7

v0.5.7 #94

Workflow file for this run

name: Publish Docker images
on:
release:
types: [published]
jobs:
push_to_registry:
name: Push Docker images to Docker Hub
runs-on: ubuntu-latest
strategy:
matrix:
dockerfile: [ Dockerfile.slim, Dockerfile.full ]
env:
IMAGE_NAME: junobuild/action
RAW_VERSION: ${{ github.ref_name }}
steps:
# Action: https://github.com/actions/checkout/releases/tag/v4.2.2
- name: Check out the repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
# Action: https://github.com/docker/login-action/releases/tag/v3.4.0
- name: Log in to Docker Hub
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Extract version for Docker Hub
run: echo "VERSION=${RAW_VERSION#v}" >> $GITHUB_ENV
# Action: https://github.com/docker/build-push-action/releases/tag/v6.18.0
- name: Build and push
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
with:
context: .
file: ${{ matrix.dockerfile }}
push: true
tags: |
${{ env.IMAGE_NAME }}:${{ env.VERSION }}${{ contains(matrix.dockerfile, 'full') && '-full' || (contains(matrix.dockerfile, 'slim') && '-slim' || '') }}
${{ env.IMAGE_NAME }}:${{ contains(matrix.dockerfile, 'slim') && 'slim' || 'full' }}
${{ env.IMAGE_NAME }}:${{ contains(matrix.dockerfile, 'slim') && 'latest' || 'full' }}
${{ contains(matrix.dockerfile, 'slim') && format('{0}:{1}', env.IMAGE_NAME, env.VERSION) || '' }}