From fd88a6cad51663d6f44b257322910efafbfb720e Mon Sep 17 00:00:00 2001 From: RA341 Date: Thu, 26 Sep 2024 11:55:53 -0400 Subject: [PATCH 1/4] fixing ghcr auth --- .github/workflows/beta.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index f849658..d34437f 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -5,6 +5,7 @@ on: push: branches: - master + - ci/cd jobs: build-docker: @@ -26,12 +27,9 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + - name: Login to GHCR registry + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin + - name: Build and push uses: docker/build-push-action@v6 with: From 7bbea4a2d9d5815f35e3e96f53e577ca63ee67ff Mon Sep 17 00:00:00 2001 From: RA341 Date: Thu, 26 Sep 2024 11:59:30 -0400 Subject: [PATCH 2/4] still fixing ghcr auth --- .github/workflows/beta.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index d34437f..785f86c 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -30,11 +30,17 @@ jobs: - name: Login to GHCR registry run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - name: Build and push - uses: docker/build-push-action@v6 - with: - push: true - tags: ${{ github.repository }}:beta + - name: build image + run: docker build . -t ghcr.io/${{ github.repository }}:beta + + - name: push + run: docker push ghcr.io/${{ github.repository }}:beta + +# - name: Build and push +# uses: docker/build-push-action@v6 +# with: +# push: true +# tags: ${{ github.repository }}:beta # if the binary needs to built directly # - name: Set up Go From db356dd141515c4b9f3fea26068485ead5e9c8c2 Mon Sep 17 00:00:00 2001 From: RA341 Date: Thu, 26 Sep 2024 12:01:51 -0400 Subject: [PATCH 3/4] fixing perm --- .github/workflows/beta.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 785f86c..941bf6e 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -14,6 +14,7 @@ jobs: contents: write # to be able to publish a GitHub release issues: write # to be able to comment on released issues pull-requests: write # to be able to comment on released pull requests + packages: write # to be able to publish docker images steps: - uses: actions/checkout@v3 with: From b83cfa08a911bd9e3270ae22c4f7bd1fb3f4d26c Mon Sep 17 00:00:00 2001 From: RA341 Date: Thu, 26 Sep 2024 12:10:52 -0400 Subject: [PATCH 4/4] cleaning up actions --- .github/workflows/beta.yml | 13 +--------- .github/workflows/release.yml | 47 +++++++++++------------------------ 2 files changed, 15 insertions(+), 45 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 941bf6e..5f1d8eb 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -5,7 +5,6 @@ on: push: branches: - master - - ci/cd jobs: build-docker: @@ -20,11 +19,7 @@ jobs: with: fetch-depth: 0 - - name: 'Get tag' - id: tagName - uses: "WyriHaximus/github-action-get-previous-tag@v1" - - ## docker image build + # docker image build - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -37,12 +32,6 @@ jobs: - name: push run: docker push ghcr.io/${{ github.repository }}:beta -# - name: Build and push -# uses: docker/build-push-action@v6 -# with: -# push: true -# tags: ${{ github.repository }}:beta - # if the binary needs to built directly # - name: Set up Go # uses: actions/setup-go@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9068e1d..7881c1c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,7 @@ name: Release on: push: branches: - - release # or main + - release jobs: tag-release: @@ -39,6 +39,8 @@ jobs: contents: write # to be able to publish a GitHub release issues: write # to be able to comment on released issues pull-requests: write # to be able to comment on released pull requests + packages: write # to be able to publish docker images + steps: - uses: actions/checkout@v3 with: @@ -48,42 +50,21 @@ jobs: id: tagName uses: "WyriHaximus/github-action-get-previous-tag@v1" - ## docker image build - + # docker image build - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 -# - name: Login to Docker Hub -# uses: docker/login-action@v3 -# with: -# registry: ghcr.io -# username: ${{ github.actor }} -# password: ${{ secrets.GITHUB_TOKEN }} - name: Login to GHCR registry run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - name: Build and push - uses: docker/build-push-action@v6 - with: - push: true - tags: ${{ github.repository }}:${{ steps.tagName.outputs.tag }} + - name: build version tagged image + run: docker build . -t ghcr.io/${{ github.repository }}:${{ steps.tagName.outputs.tag }} + + - name: push tagged + run: docker push ghcr.io/${{ github.repository }}:${{ steps.tagName.outputs.tag }} + + - name: build latest tagged image + run: docker build . -t ghcr.io/${{ github.repository }}:latest - # if the binary needs to built directly - # - name: Set up Go - # uses: actions/setup-go@v4 - # with: - # go-version: '1.22' - # - name: Install dependencies - # run: go mod tidy - # - # - name: Build - # run: go build -ldflags "-w -s" -o multipacman_linux_${{ steps.tagName.outputs.tag }} - # - # - name: Upload Release Asset - # uses: softprops/action-gh-release@v2 - # with: - # files: | - # multipacman_linux_${{ steps.tagName.outputs.tag }} - # tag_name: ${{ steps.tagName.outputs.tag }} - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: push latest + run: docker push ghcr.io/${{ github.repository }}:latest