mirror of
https://github.com/davegallant/rfd-notify.git
synced 2025-08-05 16:23:39 +00:00
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 1 to 2. - [Release notes](https://github.com/docker/setup-buildx-action/releases) - [Commits](https://github.com/docker/setup-buildx-action/compare/v1...v2) --- updated-dependencies: - dependency-name: docker/setup-buildx-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
51 lines
1.2 KiB
YAML
51 lines
1.2 KiB
YAML
name: Publish Container
|
|
on: [push]
|
|
|
|
jobs:
|
|
push_to_registry:
|
|
name: Push to container registry
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Prepare
|
|
id: prep
|
|
run: |
|
|
IMAGE_NAME=ghcr.io/${{ github.repository_owner }}/rfd-notify
|
|
VERSION=${GITHUB_REF##*/}
|
|
|
|
if [[ $GITHUB_REF == refs/heads/main ]]; then
|
|
VERSION=latest
|
|
fi
|
|
|
|
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
|
VERSION=${GITHUB_REF#refs/tags/v}
|
|
fi
|
|
|
|
TAGS="${IMAGE_NAME}:${VERSION}"
|
|
|
|
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
|
|
TAGS="$TAGS,${IMAGE_NAME}:latest"
|
|
fi
|
|
|
|
echo ::set-output name=tags::${TAGS}
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- name: Login to GitHub Packages Docker Registry
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Push to Packages
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
push: true
|
|
tags: ${{ steps.prep.outputs.tags }}
|
|
|