Skip to content

Commit

Permalink
docker: make sure containers build with capitals in username
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkwouter committed Jul 31, 2023
1 parent 7efa797 commit f438828
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/build_docker_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
timeout-minutes: 20
strategy:
matrix:
fail-fast: false
tag: [latest, debug, lto]
include:
- tag: latest
Expand All @@ -22,9 +23,12 @@ jobs:
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set docker tag
run: |
echo "DOCKER_TAG=$(echo ghcr.io/${{ github.repository }}:${{ matrix.tag }}|tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Build Docker image
run: |
docker build --build-arg buildparams="${{ matrix.build-args }}" -t ${{ matrix.tag }} . \
docker build --build-arg buildparams="${{ matrix.build-args }}" -t "${DOCKER_TAG}" . \
--label "org.opencontainers.image.revision=${{ github.sha }}" \
--label "org.opencontainers.image.created=$(date --rfc-3339=seconds --utc)"
- name: Test Docker image
Expand All @@ -33,15 +37,14 @@ jobs:
for dir in */
do
cd "$dir"
docker run --rm -v `pwd`:/usr/src/app -t ${{ matrix.tag }} make -j`nproc`
docker run --rm -v `pwd`:/usr/src/app -t "${DOCKER_TAG}" make -j`nproc`
cd ..
done
- name: Push container if on master branch
if: github.ref == 'refs/heads/master'
run: |
docker login -u "${{ github.actor }}" -p "${{ secrets.GITHUB_TOKEN }}" ghcr.io
docker tag ${{ matrix.tag }} ghcr.io/${{ github.repository }}:${{ matrix.tag }}
docker push ghcr.io/${{ github.repository }}:${{ matrix.tag }}
docker push "${DOCKER_TAG}"
xboxdev_containers:
name: Push Official Containers
Expand All @@ -50,6 +53,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
fail-fast: false
tag: [latest, debug, lto]
steps:
- name: Pull container
Expand Down

0 comments on commit f438828

Please sign in to comment.