fix: allow local act execution/testing

This commit is contained in:
hackercat
2021-05-18 20:59:03 +00:00
parent 2bf0412744
commit 377301fa5e
2 changed files with 14 additions and 13 deletions
+7 -7
View File
@@ -17,11 +17,11 @@ jobs:
build: build:
name: Build name: Build
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ ( github.actor == github.repository_owner && github.event_name != 'pull_request' ) || ( github.actor != github.repository_owner ) }} if: ${{ ( github.actor == github.repository_owner && github.event_name != 'pull_request' ) || ( github.actor != github.repository_owner ) || env.ACT }}
steps: steps:
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
id: ghcr id: ghcr
if: ${{ github.actor == github.repository_owner }} if: ${{ github.actor == github.repository_owner && !env.ACT }}
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
registry: ghcr.io registry: ghcr.io
@@ -30,7 +30,7 @@ jobs:
- name: Login to Quay - name: Login to Quay
id: quay id: quay
if: ${{ github.actor == github.repository_owner }} if: ${{ github.actor == github.repository_owner && !env.ACT }}
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
registry: quay.io registry: quay.io
@@ -39,7 +39,7 @@ jobs:
- name: Login to Docker Hub - name: Login to Docker Hub
id: dckr id: dckr
if: ${{ github.actor == github.repository_owner }} if: ${{ github.actor == github.repository_owner && !env.ACT }}
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
username: ${{ secrets.DOCKER_USER }} username: ${{ secrets.DOCKER_USER }}
@@ -66,7 +66,7 @@ jobs:
DCKR_TAG: docker.io/${{ github.repository_owner }}/alpine:act DCKR_TAG: docker.io/${{ github.repository_owner }}/alpine:act
with: with:
context: . context: .
push: ${{ github.event_name != 'pull_request' && github.event_name != 'push' }} push: ${{ github.event_name != 'pull_request' && github.event_name != 'push' && !env.ACT }}
file: ./linux/alpine/act/base/Dockerfile file: ./linux/alpine/act/base/Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7 platforms: linux/amd64,linux/arm64,linux/arm/v7
tags: | tags: |
@@ -87,14 +87,14 @@ jobs:
- name: Build and push ${{ github.repository_owner }}/alpine:runner-${{ steps.print-date.outputs.date }} - name: Build and push ${{ github.repository_owner }}/alpine:runner-${{ steps.print-date.outputs.date }}
id: runner id: runner
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
if: ${{ github.event_name != 'pull_request' && github.event_name != 'push' }} if: ${{ github.event_name != 'pull_request' && github.event_name != 'push' && !env.ACT }}
env: env:
GHCR_TAG: ghcr.io/${{ github.repository_owner }}/alpine:runner GHCR_TAG: ghcr.io/${{ github.repository_owner }}/alpine:runner
QUAY_TAG: quay.io/${{ github.repository_owner }}/alpine:runner QUAY_TAG: quay.io/${{ github.repository_owner }}/alpine:runner
DCKR_TAG: docker.io/${{ github.repository_owner }}/alpine:runner DCKR_TAG: docker.io/${{ github.repository_owner }}/alpine:runner
with: with:
context: . context: .
push: ${{ github.event_name != 'pull_request' && github.event_name != 'push' }} push: ${{ github.event_name != 'pull_request' && github.event_name != 'push' && !env.ACT }}
file: ./linux/alpine/act/runner/Dockerfile file: ./linux/alpine/act/runner/Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7 platforms: linux/amd64,linux/arm64,linux/arm/v7
tags: | tags: |
+7 -6
View File
@@ -20,7 +20,7 @@ jobs:
build: build:
name: Build name: Build
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ github.actor == github.repository_owner && github.event_name != 'pull_request' }} if: ${{ ( github.actor == github.repository_owner && github.event_name != 'pull_request' ) || ( github.actor != github.repository_owner ) || env.ACT }}
strategy: strategy:
fail-fast: true fail-fast: true
max-parallel: 4 max-parallel: 4
@@ -31,7 +31,7 @@ jobs:
steps: steps:
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
id: ghcr id: ghcr
if: ${{ github.actor == github.repository_owner }} if: ${{ github.actor == github.repository_owner && !env.ACT }}
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
registry: ghcr.io registry: ghcr.io
@@ -40,7 +40,7 @@ jobs:
- name: Login to Quay - name: Login to Quay
id: quay id: quay
if: ${{ github.actor == github.repository_owner }} if: ${{ github.actor == github.repository_owner && !env.ACT }}
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
registry: quay.io registry: quay.io
@@ -49,7 +49,7 @@ jobs:
- name: Login to Docker Hub - name: Login to Docker Hub
id: dckr id: dckr
if: ${{ github.actor == github.repository_owner }} if: ${{ github.actor == github.repository_owner && !env.ACT }}
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
username: ${{ secrets.DOCKER_USER }} username: ${{ secrets.DOCKER_USER }}
@@ -85,7 +85,7 @@ jobs:
DCKR_TAG: docker.io/${{ github.repository_owner }}/${{ matrix.BASEIMAGE }}:act-${{ matrix.TAG }} DCKR_TAG: docker.io/${{ github.repository_owner }}/${{ matrix.BASEIMAGE }}:act-${{ matrix.TAG }}
with: with:
context: . context: .
push: ${{ github.event_name != 'pull_request' && github.event_name != 'push' }} push: ${{ github.event_name != 'pull_request' && github.event_name != 'push' && !env.ACT }}
file: ./linux/${{ matrix.BASEIMAGE }}/act/Dockerfile file: ./linux/${{ matrix.BASEIMAGE }}/act/Dockerfile
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
tags: | tags: |
@@ -106,13 +106,14 @@ jobs:
- name: Build and push ${{ github.repository_owner }}/${{ matrix.BASEIMAGE }}:runner-${{ matrix.TAG }}-${{ steps.print-date.outputs.date }} - name: Build and push ${{ github.repository_owner }}/${{ matrix.BASEIMAGE }}:runner-${{ matrix.TAG }}-${{ steps.print-date.outputs.date }}
id: runner id: runner
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
if: ${{ github.event_name != 'pull_request' && github.event_name != 'push' && !env.ACT }}
env: env:
GHCR_TAG: ghcr.io/${{ github.repository_owner }}/${{ matrix.BASEIMAGE }}:runner-${{ matrix.TAG }} GHCR_TAG: ghcr.io/${{ github.repository_owner }}/${{ matrix.BASEIMAGE }}:runner-${{ matrix.TAG }}
QUAY_TAG: quay.io/${{ github.repository_owner }}/${{ matrix.BASEIMAGE }}:runner-${{ matrix.TAG }} QUAY_TAG: quay.io/${{ github.repository_owner }}/${{ matrix.BASEIMAGE }}:runner-${{ matrix.TAG }}
DCKR_TAG: docker.io/${{ github.repository_owner }}/${{ matrix.BASEIMAGE }}:runner-${{ matrix.TAG }} DCKR_TAG: docker.io/${{ github.repository_owner }}/${{ matrix.BASEIMAGE }}:runner-${{ matrix.TAG }}
with: with:
context: . context: .
push: ${{ github.event_name != 'pull_request' && github.event_name != 'push' }} push: ${{ github.event_name != 'pull_request' && github.event_name != 'push' && !env.ACT }}
file: ./linux/${{ matrix.BASEIMAGE }}/runner/Dockerfile file: ./linux/${{ matrix.BASEIMAGE }}/runner/Dockerfile
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
tags: | tags: |