Update README #32
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 | |
on: | |
pull_request_target: | |
types: [closed] | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
release_job: | |
uses: bedita/github-workflows/.github/workflows/release.yml@v2 | |
with: | |
main_branch: 'main' | |
dist_branches: '["main"]' | |
package_json_version: 'true' | |
docker_push: | |
runs-on: 'ubuntu-latest' | |
needs: release_job | |
permissions: | |
contents: read | |
packages: write | |
attestations: write | |
id-token: write | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Debug output version | |
run: | | |
echo version var ${{ needs.release_job.outputs.version }} | |
- name: Print message if no semantic version was created | |
if: contains(needs.release_job.outputs.version, 'undefined') | |
run: | | |
echo Skip version file update and docker image creation | |
- name: Update package.json version key | |
if: ${{ !contains(needs.release_job.outputs.version, 'undefined') }} | |
uses: jossef/[email protected] | |
with: | |
file: package.json | |
field: version | |
value: ${{ needs.release_job.outputs.version }} | |
- name: Log in to the Container registry | |
if: ${{ !contains(needs.release_job.outputs.version, 'undefined') }} | |
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Docker image | |
if: ${{ !contains(needs.release_job.outputs.version, 'undefined') }} | |
id: push | |
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 | |
with: | |
context: . | |
push: true | |
tags: | | |
${{ env.REGISTRY }}/${{ github.repository }}:${{ needs.release_job.outputs.version }} | |
${{ env.REGISTRY }}/${{ github.repository }}:latest |