Skip to content

chore: update create_release statement (#26) #27

chore: update create_release statement (#26)

chore: update create_release statement (#26) #27

Workflow file for this run

name: Release docker image
on:
push:
tags:
- v*
env:
REGISTRY: ghcr.io
IMAGE_NAME: w6d-io/process-rest
jobs:
release:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
packages: write
pull-requests: write
attestations: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Login to Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
- name: Build variables
id: build_env
run: |
echo "SOURCE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
echo "BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_ENV
echo "PROJECT_URL=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" >> $GITHUB_ENV
echo "VCS_REF=$GITHUB_SHA" >> $GITHUB_OUTPUT
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v5
with:
context: .
push: true
build-args: |
VERSION=${{ env.SOURCE_TAG }}
VCS_REF=${{ env.VCS_REF }}
BUILD_DATE=${{ env.BUILD_DATE }}
PROJECT_URL=${{ env.PROJECT_URL }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Run Release Drafter
id: create_release
uses: release-drafter/release-drafter@v5
with:
config-name: release-drafter.yml
publish: true
version: ${{ env.DOCKER_METADATA_OUTPUT_VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}