mirror of
https://github.com/outbackdingo/cozystack.git
synced 2026-03-21 17:41:21 +00:00
51 lines
1.2 KiB
YAML
51 lines
1.2 KiB
YAML
name: Release Workflow
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
|
|
env:
|
|
REGISTRY: ghcr.io
|
|
IMAGE_NAME: ${{ github.repository }}
|
|
|
|
jobs:
|
|
test-and-release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Run tests
|
|
run: make test
|
|
|
|
- name: Build images
|
|
run: make build
|
|
env:
|
|
DOCKER_BUILDKIT: 1
|
|
|
|
- name: Tag and push release images
|
|
run: |
|
|
VERSION=${{ github.event.release.tag_name }}
|
|
for image in $(docker images --format "{{.Repository}}:{{.Tag}}" | grep ${IMAGE_NAME}); do
|
|
docker tag ${image} ${image}:${VERSION}
|
|
docker push ${image}:${VERSION}
|
|
done
|
|
|
|
- name: Create release notes
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
files: |
|
|
README.md
|
|
CHANGELOG.md
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |