Skip to content

Commit

Permalink
fix: docker image builds moved under single job
Browse files Browse the repository at this point in the history
  • Loading branch information
KEGustafsson committed Feb 3, 2025
1 parent f10086a commit c82dce8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 61 deletions.
35 changes: 4 additions & 31 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ jobs:
- uses: actions/download-artifact@v4
with:
name: packed-modules

- name: Build and push
uses: docker/build-push-action@v5
with:
Expand All @@ -94,15 +93,8 @@ jobs:
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
tags: ${{ steps.docker_meta.outputs.tags }}

build_test_docker_images:
runs-on: ubuntu-latest
needs: [signalk-server_npm_files]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: docker_meta
- name: Docker meta for test image
id: docker_meta_test
uses: docker/metadata-action@v5
with:
images: |
Expand All @@ -113,33 +105,14 @@ jobs:
tags: |
type=ref,event=branch
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: signalkci
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_PAT }} # Personal access tokens (classic) with a scope of "write:packages" is needed to release ghcr.io package registry.
- uses: actions/download-artifact@v4
with:
name: packed-modules

- name: Modify Dockerfile for test image
run: |
sed -i 's/:latest/:testing/g' ./docker/Dockerfile
- name: Build and push
- name: Build and push test image
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
tags: ${{ steps.docker_meta_test.outputs.tags }}
35 changes: 5 additions & 30 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,16 +191,9 @@ jobs:
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
build-args: |
TAG=${{ steps.vars.outputs.tag }}
docker_image_test:
runs-on: ubuntu-latest
needs: signalk-server
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: docker_meta
TAG=${{ steps.vars.outputs.tag }}
- name: Docker meta for test image
id: docker_meta_test
uses: docker/metadata-action@v5
with:
images: |
Expand All @@ -213,34 +206,16 @@ jobs:
type=semver,pattern=v{{major}},enable=${{ !contains(github.ref, 'beta') }}
type=semver,pattern=v{{major}}.{{minor}},enable=${{ !contains(github.ref, 'beta') }}
type=raw,value=latest,enable=${{ !contains(github.ref, 'beta') }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: signalkci
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_PAT }} # Personal access tokens (classic) with a scope of "write:packages" is needed to release ghcr.io package registry.
- name: Set TAG for build-args
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Modify Dockerfile_rel for test image
run: |
sed -i 's/:latest/:testing/g' ./docker/Dockerfile_rel
- name: Build and push
- name: Build and push test image
uses: docker/build-push-action@v5
with:
file: ./docker/Dockerfile_rel
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
tags: ${{ steps.docker_meta_test.outputs.tags }}
build-args: |
TAG=${{ steps.vars.outputs.tag }}
Expand Down

0 comments on commit c82dce8

Please sign in to comment.