Skip to content

Commit

Permalink
Merge pull request #383 from jjrom/develop
Browse files Browse the repository at this point in the history
Build resto image for amd64 and arm64
  • Loading branch information
jjrom authored Nov 28, 2023
2 parents e40425f + 47a116a commit e4f3a42
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
29 changes: 12 additions & 17 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,36 +23,31 @@ jobs:
# defaults to shallow checkout
- uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

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

- name: Print values of all environment variables
run: printenv

- name: Login to DockerHub Registry
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin

- name: Build the tagged Docker image
run: docker build . --file ./build/resto/Dockerfile --tag ${NAME}/${IMAGE}:latest

- name: Unshallow repository
run: git fetch --prune --unshallow 2> /dev/null || true

- name: Tag master branch and push to repository
if: ${{ startsWith(github.ref, 'refs/heads/master') }}
- name: Build and Push Image
if: ${{ startsWith(github.ref, 'refs/heads/master') && github.event_name != 'release' }}
run: |
docker buildx build --push --platform linux/amd64,linux/arm64 --tag ${NAME}/${IMAGE}:latest --file ./build/resto/Dockerfile .
# Push image
docker push ${NAME}/${IMAGE}
- name: Tag latest release and push to repository
if: ${{ github.event_name == 'release' }}
run: |
# Get latest release tag
tag=$(git describe --tags --abbrev=0 | sed s/^v//)
# Tag image
docker tag ${NAME}/${IMAGE}:latest ${NAME}/${IMAGE}:${tag}
# Push release
docker push ${NAME}/${IMAGE}:${tag}
docker buildx build --push --platform linux/amd64,linux/arm64 -t ${NAME}/${IMAGE}:latest -t ${NAME}/${IMAGE}:$tag --file ./build/resto/Dockerfile .
4 changes: 2 additions & 2 deletions build/resto/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM jjrom/nginx-fpm:8.1-1
FROM jjrom/nginx-fpm:8.2
LABEL maintainer="jerome.gasperi@gmail.com"

# [IMPORTANT] S6_BEHAVIOUR_IF_STAGE2_FAILS set to 2 in order to restart the resto component until the database is ready
ENV BUILD_DIR=./build/resto \
PHP_VERSION=8.1 \
PHP_VERSION=8.2 \
RESTO_DEBUG=1 \
S6_BEHAVIOUR_IF_STAGE2_FAILS=2

Expand Down

0 comments on commit e4f3a42

Please sign in to comment.