Skip to content

Commit

Permalink
Fix CI for building image on main (#49)
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Auerbeck <[email protected]>
Co-authored-by: Tyler Auerbeck <[email protected]>
  • Loading branch information
tylerauerbeck and tylerauerbeck authored Jul 19, 2023
1 parent f781170 commit 02eddc7
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 34 deletions.
35 changes: 1 addition & 34 deletions .github/workflows/image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
38 changes: 38 additions & 0 deletions .github/workflows/image-main-latest.yml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit 02eddc7

Please sign in to comment.