trigger actions 10 #44
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: Build Image and Test | |
on: | |
push: | |
env: | |
IMAGE_TAG: issue-docker-gha-load-very-slow:latest | |
jobs: | |
ActionWithCache: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
push: false | |
load: true | |
context: . | |
file: ./Dockerfile | |
tags: ${{env.IMAGE_TAG}} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Run Docker image | |
id: docker-run | |
shell: bash | |
run: | | |
docker image ls | |
echo "Running Docker image ${IMAGE_TAG}" | |
docker run --init --rm "${IMAGE_TAG}" | |
ActionWithoutCache: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
push: false | |
load: true | |
context: . | |
file: ./Dockerfile | |
tags: ${{env.IMAGE_TAG}} | |
- name: Run Docker image | |
id: docker-run | |
shell: bash | |
run: | | |
docker image ls | |
echo "Running Docker image ${IMAGE_TAG}" | |
docker run --init --rm "${IMAGE_TAG}" | |
ExplicitDockerBuildxCommand: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Run Docker image | |
id: docker-run | |
shell: bash | |
run: | | |
docker buildx build -t ${IMAGE_TAG} -f ./Dockerfile . | |
docker image ls | |
echo "Running Docker image ${IMAGE_TAG}" | |
docker run --init --rm "${IMAGE_TAG}" | |
UseGhcrAndGhaCache: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ghcr.io/${{ github.repository }} | |
tags: latest | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
context: . | |
file: ./Dockerfile | |
tags: ${{ steps.meta.outputs.tags }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Run Docker image | |
id: docker-run | |
shell: bash | |
env: | |
IMAGE_TAG2: ${{ steps.meta.outputs.tags }} | |
run: | | |
echo "Running Docker image ${IMAGE_TAG2}" | |
docker run --init --rm "${IMAGE_TAG2}" | |
UseGhcrAndRegistryCache: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ghcr.io/${{ github.repository }} | |
tags: latest | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
context: . | |
file: ./Dockerfile | |
tags: ${{ steps.meta.outputs.tags }} | |
cache-from: type=registry,ref=${{ steps.meta.outputs.tags }}-cache | |
cache-to: type=registry,ref=${{ steps.meta.outputs.tags }}-cache,mode=max | |
- name: Run Docker image | |
id: docker-run | |
shell: bash | |
env: | |
IMAGE_TAG2: ${{ steps.meta.outputs.tags }} | |
run: | | |
echo "Running Docker image ${IMAGE_TAG2}" | |
docker run --init --rm "${IMAGE_TAG2}" | |
UseDoubleCache: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./Dockerfile | |
tags: ${{env.IMAGE_TAG}} | |
load: true | |
cache-from: type=gha | |
cache-to: | | |
type=gha,mode=max | |
type=inline | |
- name: Run Docker image | |
id: docker-run | |
shell: bash | |
run: | | |
docker image ls | |
echo "Running Docker image ${IMAGE_TAG}" | |
docker run --init --rm "${IMAGE_TAG}" | |
# dummy |