Skip to content

github.com/jdesgats/golang-youtube #155

github.com/jdesgats/golang-youtube

github.com/jdesgats/golang-youtube #155

Workflow file for this run

# https://github.com/docker/build-push-action
# https://docs.github.com/en/actions/learn-github-actions/contexts
name: docker
permissions:
contents: write
packages: write
id-token: write
on:
push:
branches:
- main
paths-ignore:
- 'helm/**'
- '.github/workflows/helm.yaml'
env:
REGISTRY: ghcr.io
jobs:
build-push:
runs-on: ubuntu-latest
steps:
- name: version
run: |
VERSION=$( date '+%y.%m%d.%H%M' | sed 's/\.0*/./g' )
echo "VERSION=$VERSION" >> $GITHUB_ENV
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v5
id: meta
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}
- uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ env.VERSION }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: tag
run: |
git config user.name github-actions
git config user.email "[email protected]"
git tag $VERSION
git push origin $VERSION