From 52c3132424817f89cc232424ba71ca5b5eae1080 Mon Sep 17 00:00:00 2001 From: Tyler Stiene Date: Wed, 15 Dec 2021 01:11:31 -0500 Subject: [PATCH] chore: seperate binary and docker actions --- .github/workflows/build-docker.yml | 33 +++++++++++++++++++++++++++++ .github/workflows/build-release.yml | 15 ++++--------- 2 files changed, 37 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/build-docker.yml diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml new file mode 100644 index 0000000..c3ee9ed --- /dev/null +++ b/.github/workflows/build-docker.yml @@ -0,0 +1,33 @@ +name: 'Docker' +on: + create: + tags: + - v* + +jobs: + docker-build-push: + runs-on: ubuntu-latest + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Log in to Docker Hub + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + if: startsWith(github.ref, 'refs/tags/') + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: stieneee/mumble-discord-bridge:latest,stieneee/mumble-discord-bridge:${{ github.ref_name }},ghcr.io/stieneee/mumble-discord-bridge:latest,ghcr.io/stieneee/mumble-discord-bridge:${{ github.ref_name }} \ No newline at end of file diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index face42b..f8a20a4 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -16,8 +16,8 @@ jobs: with: fetch-depth: 0 - - name: Install libopus-dev - run: sudo apt update && sudo apt-get -y install libopus-dev + - name: Install libopus-dev zip + run: sudo apt update && sudo apt-get -y install libopus-dev zip - name: Set up Go uses: actions/setup-go@v2 @@ -28,20 +28,13 @@ jobs: run: go install github.com/google/go-licenses@latest - name: go-license save - run: go-licenses save ./cmd/mumble-discord-bridge --force --save_path="./LICENSES" - - - name: Log in to Docker Hub - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 - if: startsWith(github.ref, 'refs/tags/') - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + run: go-licenses save ./cmd/mumble-discord-bridge --force --save_path="./LICENSES" && zip -r -9 LICENSES.zip ./LICENSES - name: Run GoReleaser Build uses: goreleaser/goreleaser-action@v2 with: version: latest - args: build --rm-dist + args: build --rm-dist --skip-validate env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}