From f3b8923e32b7763912a0b3b2e592f94936b99d41 Mon Sep 17 00:00:00 2001 From: aunefyren Date: Sun, 11 Dec 2022 15:46:30 +0100 Subject: [PATCH] Updated actions --- .github/workflows/docker-image-beta.yml | 29 +++++++++++++++++++++++- .github/workflows/docker-image.yml | 30 +++++++++++++++++++++++-- Dockerfile | 2 +- 3 files changed, 57 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-image-beta.yml b/.github/workflows/docker-image-beta.yml index a96a82b..68d6f44 100644 --- a/.github/workflows/docker-image-beta.yml +++ b/.github/workflows/docker-image-beta.yml @@ -10,14 +10,41 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Set up Docker metadata + id: meta + uses: docker/metadata-action@v3 + with: + images: | + aunefyren/wrapperr + ghcr.io/${{ github.repository_owner }}/wrapperr + tags: | + type-raw,value=beta + flavor: | + latest=false + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: arm64 + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 - name: Login to Docker Hub uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + - name: Login to GHCR + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GIT_HUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v3 with: + builder: ${{ steps.buildx.outputs.name }} + file: ./Dockerfile + platforms: linux/amd64,linux/arm64 push: true context: . - tags: aunefyren/wrapperr:beta \ No newline at end of file + tags: ${{ steps.meta.outputs.tags }} \ No newline at end of file diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index f0c3ed9..c272cb1 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -10,15 +10,41 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Set up Docker metadata + id: meta + uses: docker/metadata-action@v3 + with: + images: | + aunefyren/wrapperr + ghcr.io/${{ github.repository_owner }}/wrapperr + tags: | + type-raw,value=github.ref_name + flavor: | + latest=true + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: arm64 + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 - name: Login to Docker Hub uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - registry: docker.io + - name: Login to GHCR + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GIT_HUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v3 with: + builder: ${{ steps.buildx.outputs.name }} + file: ./Dockerfile + platforms: linux/amd64,linux/arm64 push: true context: . - tags: aunefyren/wrapperr:latest, aunefyren/wrapperr:${{ github.ref_name }} \ No newline at end of file + tags: ${{ steps.meta.outputs.tags }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index e28a0c5..ddf792f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ WORKDIR /app COPY . . -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build +RUN CGO_ENABLED=0 go build EXPOSE ${port}