Update all dependencies #306
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Build & Push | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- "**.md" | |
pull_request: | |
paths-ignore: | |
- "**.md" | |
workflow_dispatch: | |
jobs: | |
push_to_registry: | |
name: Build & Push docker image to Docker Hub | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Extract metadata to env variables | |
uses: HSLdevcom/jore4-tools/github-actions/extract-metadata@extract-metadata-v1 | |
- name: Pull previous images to support caching | |
run: | | |
docker pull $IMAGE_NAME:builder || >&2 echo "Previous builder image not found" | |
docker pull $IMAGE_NAME:latest || >&2 echo "Previous image not found" | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: 'arm64' | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.JORE4_DOCKERHUB_USER }} | |
password: ${{ secrets.JORE4_DOCKERHUB_TOKEN }} | |
- name: Build and push image tagged with commit ID to Docker Hub | |
run: | | |
docker buildx build \ | |
--push \ | |
--platform linux/amd64,linux/arm64 \ | |
--cache-from=$IMAGE_NAME:builder \ | |
--cache-from=$IMAGE_NAME:latest \ | |
-t $IMAGE_NAME:$COMMIT_ID \ | |
. | |
- name: Build and push :builder and :latest tag to Docker Hub | |
if: ${{ github.ref == 'refs/heads/main' }} | |
run: | | |
docker buildx build \ | |
--push \ | |
--platform linux/amd64,linux/arm64 \ | |
--target builder \ | |
--cache-from=$IMAGE_NAME:builder \ | |
-t $IMAGE_NAME:builder \ | |
. | |
docker buildx build \ | |
--push \ | |
--platform linux/amd64,linux/arm64 \ | |
--cache-from=$IMAGE_NAME:builder \ | |
--cache-from=$IMAGE_NAME:latest \ | |
-t $IMAGE_NAME:latest \ | |
. | |
run_e2e_tests: | |
name: Run cypress e2e tests | |
needs: push_to_registry | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Extract metadata to env variables | |
uses: HSLdevcom/jore4-tools/github-actions/extract-metadata@extract-metadata-v1 | |
- name: Start e2e env | |
uses: HSLdevcom/jore4-tools/github-actions/setup-e2e-environment@setup-e2e-environment-v1 | |
with: | |
mapmatching_version: "${{ env.IMAGE_NAME }}:${{ env.COMMIT_ID }}" | |
- name: Seed infrastructure links | |
uses: HSLdevcom/jore4-tools/github-actions/seed-infrastructure-links@seed-infrastructure-links-v1 | |
- name: Run e2e tests from github action | |
uses: HSLdevcom/jore4-tools/github-actions/run-cypress-tests@run-cypress-tests-v1 |