attempt 5 #26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
name: Build Linux | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1 | |
id: go | |
- name: Build | |
run: | | |
make docker | |
- name: release | |
id: release | |
env: | |
X: Y | |
env: | |
# I couldn't get the releases to work with the GITHUB_TOKEN so made secrets... :( | |
# GH_DEPLOY_USER: ${{ secrets.GH_DEPLOY_USER }} | |
# GH_DEPLOY_KEY: ${{ secrets.GH_DEPLOY_KEY }} | |
DOCKER_USER: ${{ secrets.DOCKER_USER }} | |
DOCKER_PASS: ${{ secrets.DOCKER_PASS }} | |
IMAGE: treeder/bump | |
run: | | |
git fetch --tags | |
git tag | |
git config --global user.email "treeder+github@gmail.com" | |
git config --global user.name "Github Action" | |
wget -O - https://raw.githubusercontent.com/treeder/bump/master/gitbump.sh | bash | |
version=$(git tag --sort=-refname --list "v[0-9]*" | head -n 1) | |
echo "new version $version" | |
echo "VERSION=$version" >> "$GITHUB_OUTPUT" | |
docker tag $IMAGE:latest $IMAGE:$version | |
docker tag $IMAGE:latest ghcr.io/$IMAGE:$version | |
docker tag $IMAGE:latest ghcr.io/$IMAGE:latest | |
# docker hub release | |
echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin | |
docker push $IMAGE:latest | |
docker push $IMAGE:$version | |
- name: 'Login to GitHub Container Registry' | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{github.actor}} | |
password: ${{secrets.GITHUB_TOKEN}} | |
- name: 'Push image to GitHub Container Registry' | |
env: | |
IMAGE: treeder/bump | |
VERSION: ${{ steps.release.outputs.VERSION }} | |
run: | | |
echo "VERSION2=$VERSION" | |
docker push ghcr.io/$IMAGE:latest | |
docker push ghcr.io/$IMAGE:$VERSION | |