mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-03-05 03:20:28 +00:00
86 lines
3.1 KiB
YAML
86 lines
3.1 KiB
YAML
name: release
|
|
|
|
on:
|
|
push:
|
|
tags: '*'
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Setup QEMU
|
|
uses: docker/setup-qemu-action@v1
|
|
with:
|
|
platforms: all
|
|
- name: Setup Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
with:
|
|
buildkitd-flags: "--debug"
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v1
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.GHCR_TOKEN }}
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
- name: Prepare
|
|
id: prep
|
|
run: |
|
|
VERSION=sha-${GITHUB_SHA::8}
|
|
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
|
VERSION=${GITHUB_REF/refs\/tags\//}
|
|
fi
|
|
echo ::set-output name=BUILD_DATE::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
|
|
echo ::set-output name=VERSION::${VERSION}
|
|
- name: Publish multi-arch image
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
push: true
|
|
builder: ${{ steps.buildx.outputs.name }}
|
|
context: .
|
|
file: ./Dockerfile
|
|
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
|
tags: |
|
|
docker.io/stefanprodan/podinfo:${{ steps.prep.outputs.VERSION }}
|
|
docker.io/stefanprodan/podinfo:latest
|
|
ghcr.io/stefanprodan/podinfo:${{ steps.prep.outputs.VERSION }}
|
|
labels: |
|
|
org.opencontainers.image.title=${{ github.event.repository.name }}
|
|
org.opencontainers.image.description=${{ github.event.repository.description }}
|
|
org.opencontainers.image.source=${{ github.event.repository.html_url }}
|
|
org.opencontainers.image.url=${{ github.event.repository.html_url }}
|
|
org.opencontainers.image.revision=${{ github.sha }}
|
|
org.opencontainers.image.version=${{ steps.prep.outputs.VERSION }}
|
|
org.opencontainers.image.created=${{ steps.prep.outputs.BUILD_DATE }}
|
|
- name: Publish base image
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
push: true
|
|
builder: ${{ steps.buildx.outputs.name }}
|
|
context: .
|
|
platforms: linux/amd64
|
|
file: ./Dockerfile.base
|
|
tags: docker.io/stefanprodan/podinfo-base:latest
|
|
- name: Publish helm chart
|
|
uses: stefanprodan/helm-gh-pages@master
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
- uses: ./.github/actions/release-notes
|
|
- name: Generate release notes
|
|
run: |
|
|
echo 'CHANGELOG' > /tmp/release.txt
|
|
github-release-notes -org stefanprodan -repo podinfo -since-latest-release >> /tmp/release.txt
|
|
- name: Publish release
|
|
uses: goreleaser/goreleaser-action@v1
|
|
with:
|
|
version: latest
|
|
args: release --release-notes=/tmp/release.txt
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|