Add Code of Conduct and Contribution Guidelines, Update Readme #8
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: Docker Build and Push | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
jobs: | |
build-and-release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v6 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
version: '~> v2' | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
VERSION: ${{ github.ref_name }} | |
GIT_COMMIT: ${{ github.sha }} | |
BUILD_DATE: $(date -u +"%Y-%m-%dT%H:%M:%SZ") | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Docker build and push | |
run: | | |
docker buildx build \ | |
--platform linux/amd64 \ | |
--pull \ | |
--build-arg VERSION=${{ github.ref_name }} \ | |
--build-arg GIT_COMMIT=${{ github.sha }} \ | |
--build-arg BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \ | |
--cache-from supporttools/gokubebalancer:latest \ | |
-t supporttools/gokubebalancer:"${{ github.ref_name }}" \ | |
-t supporttools/gokubebalancer:latest \ | |
--push \ | |
-f Dockerfile . | |
- name: Install Snapcraft | |
run: sudo snap install snapcraft --classic | |
- name: Build Snap package | |
run: | | |
# Update the version in snapcraft.yaml | |
sed -i "s/version: '.*'/version: '${{ github.ref_name }}'/g" snapcraft.yaml | |
snapcraft pack | |
# - name: Publish Snap package | |
# env: | |
# SNAPCRAFT_LOGIN: ${{ secrets.SNAPCRAFT_LOGIN }} | |
# run: | | |
# snapcraft login --with $SNAPCRAFT_LOGIN | |
# snapcraft upload gokubebalancer_*.snap --release=edge |