diff --git a/.github/workflows/image-build.yml b/.github/workflows/image-build.yml index b42a9b70..fdd00361 100644 --- a/.github/workflows/image-build.yml +++ b/.github/workflows/image-build.yml @@ -28,37 +28,4 @@ jobs: with: imageName: ghcr.io/${{ github.repository }}-devcontainer cacheFrom: ghcr.io/${{ github.repository }}-devcontainer - push: always - - image-build: - runs-on: ubuntu-latest - permissions: - packages: write - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Registry Login - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Docker Metadata - id: metadata - uses: docker/metadata-action@v4 - with: - images: | - ghcr.io/${{ github.repository }} - tags: | - type=sha - type=raw,value=latest,enable={{is_default_branch}} - - - name: Build+Push - uses: docker/build-push-action@v4 - with: - context: . - push: true - tags: ${{ steps.metadata.outputs.tags }} + push: always \ No newline at end of file diff --git a/.github/workflows/image-main-latest.yml b/.github/workflows/image-main-latest.yml new file mode 100644 index 00000000..b63fbd71 --- /dev/null +++ b/.github/workflows/image-main-latest.yml @@ -0,0 +1,38 @@ +name: Publish main-latest image +on: + push: + branches: + - main + +jobs: + goreleaser: + runs-on: ubuntu-latest + permissions: + contents: write + packages: write + steps: + - name: Log in to GHCR + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin + + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - run: git fetch --force --tags + + - uses: actions/setup-go@v4 + with: + go-version-file: go.mod + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v4 + with: + distribution: goreleaser-pro + version: latest + args: release --nightly --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} \ No newline at end of file