Add typescript p-chain tests #14
This file contains hidden or 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: container-images | |
| on: | |
| push: | |
| branches: [ "main", "feature/**" ] | |
| tags: [ "v*" ] | |
| jobs: | |
| build-and-push-matrix: | |
| name: Build & Push | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write | |
| env: | |
| USE_DOCKER_HUB: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: docker/setup-qemu-action@v3 | |
| - uses: docker/setup-buildx-action@v3 | |
| - run: echo "IMAGE_TAG=dev" >> $GITHUB_ENV | |
| if: github.ref_name == 'main' || startsWith(github.ref_name, 'feature/') | |
| - run: echo "IMAGE_TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| - name: Login to ghcr.io | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Login to docker.io | |
| if: ${{ env.USE_DOCKER_HUB == 'true' }} | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_UID }} | |
| password: ${{ secrets.DOCKER_HUB_PAT }} | |
| - name: Build standard image | |
| run: | | |
| TAGS="--tag ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }}" | |
| if [ "${USE_DOCKER_HUB}" = "true" ]; then | |
| TAGS="$TAGS --tag ${{ secrets.DOCKER_HUB_REPO }}:${{ env.IMAGE_TAG }}" | |
| fi | |
| docker buildx build \ | |
| --platform linux/amd64,linux/arm64 \ | |
| $TAGS \ | |
| --file ./Dockerfile \ | |
| --output type=image,push=true \ | |
| . | |
| - name: Build distroless image | |
| run: | | |
| TAGS="--tag ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }}-dless" | |
| if [ "${USE_DOCKER_HUB}" = "true" ]; then | |
| TAGS="$TAGS --tag ${{ secrets.DOCKER_HUB_REPO }}:${{ env.IMAGE_TAG }}-dless" | |
| fi | |
| docker buildx build \ | |
| --platform linux/amd64,linux/arm64 \ | |
| $TAGS \ | |
| --file ./Dockerfile.dless \ | |
| --output type=image,push=true \ | |
| . |