Skip to content

release

release #28

Workflow file for this run

name: release
on:
release:
types: [published]
env:
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Docker
uses: docker/login-action@v3
if: env.REGISTRY_USERNAME != ''
with:
registry: quay.io
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build Docker image
if: env.REGISTRY_USERNAME != ''
run: |
VERSION=$(echo ${{ github.event.release.tag_name }} | sed 's/v//')
docker build --pull --tag quay.io/terraform-docs/gh-actions:"${VERSION}" .
docker build --pull --tag quay.io/terraform-docs/gh-actions:latest .
docker push quay.io/terraform-docs/gh-actions:"${VERSION}"
docker push quay.io/terraform-docs/gh-actions:latest
update-tag:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- run: |
VERSION=$(echo ${{ github.event.release.tag_name }} | cut -d. -f1)
git tag -f "${VERSION}"
git push -f --tags