add: name to machines and version.txt #23
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: Build, Publish Docker Image, and Create Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
commit-version: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Get Git Tag and write to version.txt | |
run: | | |
TAG=$(git describe --tags --abbrev=0) | |
echo $TAG > version.txt | |
- name: Commit and push version.txt | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: "Update version.txt to $TAG" | |
file_pattern: "version.txt" | |
branch: ${{ github.ref }} | |
build: | |
needs: commit-version | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Convert owner and repository name to lowercase | |
id: lowercase | |
run: | | |
echo "OWNER=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | |
echo "REPO_NAME=$(echo 'laundrytracker' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | |
- name: Log in to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
tags: | | |
ghcr.io/${{ env.OWNER }}/${{ env.REPO_NAME }}:${{ github.ref_name }} | |
ghcr.io/${{ env.OWNER }}/${{ env.REPO_NAME }}:latest | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Create Release | |
id: create_release | |
uses: meeDamian/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref }} | |
gzip: folders |