Skip to content

Commit

Permalink
Parameterized env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasleplus committed Mar 14, 2024
1 parent bb4da01 commit 8cdf337
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
platform: ['linux/amd64', 'linux/arm64']
runs-on: ubuntu-latest
steps:
- name: Set IMAGE
run: echo "IMAGE=${GITHUB_REPOSITORY#*/docker-}" >> "${GITHUB_ENV}"
- uses: actions/checkout@v4
- name: Pull the latest ${{ matrix.platform }} image
run: docker pull --platform ${{ matrix.platform }} ${{ github.repository_owner }}/latex
run: docker pull --platform "${{ matrix.platform }}" "${GITHUB_REPOSITORY_OWNER}/${IMAGE}"
8 changes: 5 additions & 3 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set IMAGE
run: echo "IMAGE=${GITHUB_REPOSITORY#*/docker-}" >> "${GITHUB_ENV}"
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/metadata-action@v5
id: meta
with:
images: ${{ github.repository_owner }}/latex
images: ${{ github.repository_owner }}/${{ env.IMAGE }}
tags: |
type=schedule
type=ref,event=branch
Expand All @@ -36,13 +38,13 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/build-push-action@v5
with:
context: latex
context: ${{ env.IMAGE }}
platforms: linux/amd64,linux/arm64
pull: true
push: ${{ github.event_name != 'pull_request' }}
sbom: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Test the Docker image
working-directory: latex
working-directory: ${{ env.IMAGE }}
run: docker compose -f docker-compose.test.yml run sut

0 comments on commit 8cdf337

Please sign in to comment.