Skip to content

Bump golang.org/x/crypto (#16) #18

Bump golang.org/x/crypto (#16)

Bump golang.org/x/crypto (#16) #18

name: Build and Publish e6-cache to GHCR
on:
push:
branches:
- main
jobs:
bump-version-build-push:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0 # so we can fetch tags
- name: Set up Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Get latest tag and bump version
id: versioning
run: |
latest_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
echo "Latest tag: $latest_tag"
IFS='.' read -r major minor patch <<< "${latest_tag#v}"
patch=$((patch + 1))
new_tag="v${major}.${minor}.${patch}"
echo "New tag: $new_tag"
echo "NEW_TAG=$new_tag" >> $GITHUB_ENV
- name: Create Git tag and release
run: |
git tag $NEW_TAG
git push origin $NEW_TAG
gh release create $NEW_TAG \
--title "$NEW_TAG" \
--notes "Auto-release $NEW_TAG"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ env.NEW_TAG }}
ghcr.io/${{ github.repository }}:latest