chore: test push #4
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 Docker Image and Publish Release | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
build_and_release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log in to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GHCR_TOKEN }} | |
- name: Build Docker image | |
run: | | |
docker build -t ghcr.io/${{ github.repository }}:${{ github.ref_name }} . | |
- name: Push Docker image to GitHub Container Registry | |
run: | | |
docker push ghcr.io/${{ github.repository }}:${{ github.ref_name }} | |
- name: Generate release notes | |
id: generate_release_notes | |
run: | | |
release_notes=$(git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"* %s (%an)" | sed 's/\\n/\\n\\n/g') | |
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV | |
echo "$release_notes" >> $GITHUB_ENV | |
echo "EOF" >> $GITHUB_ENV | |
- name: Create .tar.gz archive of repository files | |
run: | | |
# Create a tarball of the repository | |
tar -czf release-${{ github.ref_name }}.tar.gz --exclude .git --exclude .github . | |
- name: Upload .tar.gz archive as a GitHub Release asset | |
id: release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ github.ref_name }} | |
release_name: Release ${{ github.ref_name }} | |
body: ${{ env.RELEASE_NOTES }} | |
files: release-${{ github.ref_name }}.tar.gz | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Output Release URL | |
run: | | |
echo "Release URL: ${{ steps.release.outputs.html_url }}" |