Skip to content

Merge pull request #10 from siderolabs/release-0.4 #33

Merge pull request #10 from siderolabs/release-0.4

Merge pull request #10 from siderolabs/release-0.4 #33

Workflow file for this run

name: GitHub Container Registry
on:
push:
paths-ignore:
- '.github/**'
- '.gitignore'
- 'deploy/**'
- 'docs/**'
- 'LICENSE'
- 'README.md'
jobs:
ghr_push:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v2
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# publish tags to talos-vmtoolsd:version and talos-vmtoolsd:latest
# publish branches to talos-vmtoolsd-unstable:branch
# requires GitHub actions access to packages to be configured
- name: Publish
run: |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
IMGPATH=ghcr.io/${{ github.repository }}
VERSION=$(echo $VERSION | sed -e 's/^v//')
docker build . -t $IMGPATH:$VERSION -t $IMGPATH:latest
docker push $IMGPATH:$VERSION
docker push $IMGPATH:latest
else
IMGPATH=ghcr.io/${{ github.repository }}-unstable
[ "$VERSION" == "master" ] && VERSION=latest
docker build . -t $IMGPATH:$VERSION
docker push $IMGPATH:$VERSION
fi