Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix image related workflows #14

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ on: [pull_request]
jobs:
build-images:
runs-on: ubuntu-latest
env:
REPOSITORY: ghcr.io/${{ github.repository }}
steps:
- name: Set repository as lower-case output variable
id: repo_name
run: echo ::set-output name=repository::$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')

- name: Check out code into the Go module directory
uses: actions/checkout@v3

Expand All @@ -16,5 +18,5 @@ jobs:
uses: docker/build-push-action@v3
with:
push: false
tags: gchr.io/${{ github.repository }}:latest-amd64
tags: ghcr.io/${{ steps.repo_name.outputs.repository }}:latest-amd64
file: ./Dockerfile
18 changes: 12 additions & 6 deletions .github/workflows/push-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ on:
jobs:
build-push-amd64:
runs-on: ubuntu-latest
env:
REPOSITORY: ghcr.io/${{ github.repository }}
steps:
- name: Set repository as lower-case output variable
id: repo_name
run: echo ::set-output name=repository::$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')

- name: Check out code into the Go module directory
uses: actions/checkout@v3

Expand All @@ -19,7 +21,7 @@ jobs:
id: docker_meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
images: ghcr.io/${{ steps.repo_name.outputs.repository }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
Expand All @@ -33,16 +35,18 @@ jobs:
with:
push: true
tags: |
ghcr.io/${{ github.repository }}:latest-amd64
ghcr.io/${{ steps.repo_name.outputs.repository }}:latest-amd64
labels: ${{ steps.docker_meta.outputs.labels }}
file: ./Dockerfile

create-push-manifest:
needs: [build-push-amd64]
runs-on: ubuntu-latest
env:
REPOSITORY: ghcr.io/${{ github.repository }}
steps:
- name: Set repository as lower-case output variable
id: repo_name
run: echo ::set-output name=repository::$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

Expand All @@ -54,6 +58,8 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Create manifest for multi-arch images
env:
REPOSITORY: ghcr.io/${{ steps.repo_name.outputs.repository }}
run: |
# Get artifacts from previous steps
docker pull ${{ env.REPOSITORY }}:latest-amd64
Expand Down
18 changes: 13 additions & 5 deletions .github/workflows/push-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ jobs:
name: Image push/amd64
runs-on: ubuntu-latest
steps:
- name: Set repository as lower-case output variable
id: repo_name
run: echo ::set-output name=repository::$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')

- name: Check out code into the Go module directory
uses: actions/checkout@v3

Expand All @@ -25,7 +29,7 @@ jobs:
id: docker_meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
images: ghcr.io/${{ steps.repo_name.outputs.repository }}
flavor: |
latest=false

Expand All @@ -35,25 +39,27 @@ jobs:
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:stable-amd64
ghcr.io/${{ steps.repo_name.outputs.repository }}:stable-amd64
${{ steps.docker_meta.outputs.tags }}-amd64
labels: ${{ steps.docker_meta.outputs.labels }}
file: ./Dockerfile

create-push-manifest:
needs: [build-push-amd64]
runs-on: ubuntu-latest
env:
REPOSITORY: ghcr.io/${{ github.repository }}
steps:
- name: Set repository as lower-case output variable
id: repo_name
run: echo ::set-output name=repository::$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
images: ghcr.io/${{ steps.repo_name.outputs.repository }}
flavor: |
latest=false

Expand All @@ -65,6 +71,8 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Create manifest for multi-arch images
env:
REPOSITORY: ghcr.io/${{ steps.repo_name.outputs.repository }}
run: |
# Get artifacts from previous steps
docker pull ${{ steps.docker_meta.outputs.tags }}-amd64
Expand Down