add simple example to README #21
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 | |
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" | |
# docker it | |
echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin | |
docker tag $IMAGE:latest $IMAGE:$version | |
docker push $IMAGE:latest | |
docker push $IMAGE:$version |