v0.2.1 #3
Workflow file for this run
This file contains 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: Release images | |
on: | |
release: | |
types: | |
- released | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_BASE: ${{ github.repository }} | |
IMAGE_NAME: scan | |
jobs: | |
build: | |
name: Build and release images | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- id: createImageTag | |
name: Create image tag | |
run: | | |
IMAGE_TAG=$(echo ${{ github.event.release.tag_name }} | sed 's/v//') | |
echo "imageTag=$IMAGE_TAG" >> $GITHUB_OUTPUT | |
- id: createImageBase | |
run: | | |
echo "imageBase=${IMAGE_BASE,,}" >> $GITHUB_OUTPUT | |
- name: Setup Docker buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log into registry ${{ env.REGISTRY }} | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and release Docker image | |
id: build-and-push | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: build/images/Dockerfile.${{env.IMAGE_NAME}} | |
push: true | |
tags: ${{env.REGISTRY}}/${{steps.createImageBase.outputs.imageBase}}/${{env.IMAGE_NAME}}:${{steps.createImageTag.outputs.imageTag}} |