Build and Publish to Docker Hub #16
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: Publish | |
on: | |
release: | |
types: | |
- published | |
jobs: | |
update-versions-changelog: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: main | |
- name: Strip prefix from tag and return version | |
id: version | |
run: | | |
TAG=${{ github.event.release.tag_name }} | |
echo "version=${TAG}" >> "$GITHUB_OUTPUT" | |
- name: Echo version | |
run: | | |
echo ${{ steps.version.outputs.version }} | |
# - name: Update root package.json version | |
# uses: jossef/[email protected] | |
# with: | |
# file: package.json | |
# field: version | |
# value: ${{ steps.version.outputs.version }} | |
# - name: Update laskakit-data-feeder package.json version | |
# uses: jossef/[email protected] | |
# with: | |
# file: laskakit-data-feeder/package.json | |
# field: version | |
# value: ${{ steps.version.outputs.version }} | |
# - name: Update laskakit-data-feeder addon config.json version | |
# uses: jossef/[email protected] | |
# with: | |
# file: laskakit-data-feeder/config.json | |
# field: version | |
# value: ${{ steps.version.outputs.version }} | |
- name: Extract release date from git tag | |
id: release_date | |
run: | | |
echo "date=$(git log -1 --date=short --format=%ad '${{ github.event.release.tag_name }}')" >> $GITHUB_OUTPUT; | |
- name: Update Changelog | |
uses: stefanzweifel/changelog-updater-action@v1 | |
with: | |
latest-version: ${{ steps.version.outputs.version }} | |
release-date: ${{ steps.release_date.outputs.date }} | |
release-notes: ${{ github.event.release.body }} | |
- name: Commit and push | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: "chore: Release ${{ steps.version.outputs.version }} [skip ci]" | |
# publish-docker: | |
# name: Publish to Docker Hub | |
# runs-on: ubuntu-latest | |
# needs: | |
# - update-versions-changelog | |
# steps: | |
# - uses: actions/checkout@v3 | |
# with: | |
# ref: main | |
# - name: Login to DockerHub | |
# uses: docker/login-action@v2 | |
# with: | |
# username: ${{ secrets.DOCKERHUB_USERNAME }} | |
# password: ${{ secrets.DOCKERHUB_TOKEN }} | |
# - name: Publish to Docker Hub | |
# uses: home-assistant/builder@master | |
# with: | |
# args: | | |
# --all \ | |
# --target laskakit-data-feeder \ | |
# --docker-hub ${{ secrets.DOCKERHUB_USERNAME }} | |
# update-add-ons-repository: | |
# name: 📢 Publish Add-on in Homeassistant | |
# runs-on: ubuntu-latest | |
# needs: | |
# - publish-docker | |
# steps: | |
# - name: 🚀 Dispatch Repository Updater update signal | |
# uses: peter-evans/repository-dispatch@v1 | |
# with: | |
# token: ${{ secrets.HA_DISPATCH_TOKEN }} | |
# repository: radoslavirha/homeassistant-addons | |
# event-type: update | |
# client-payload: '{"addon": "laskakit-data-feeder"}' |