Fix CI for deprecated set_output

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alex@openfaas.com>
This commit is contained in:
Alex Ellis (OpenFaaS Ltd) 2022-12-14 11:29:08 +00:00
parent 004bbddadb
commit b31419c8de
2 changed files with 61 additions and 32 deletions

View File

@ -23,12 +23,17 @@ jobs:
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Get TAG
id: get_tag
run: echo ::set-output name=TAG::latest-dev
- name: Get git commit
id: get_git_commit
run: echo "GIT_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Get version
id: get_version
run: echo "VERSION=$(git describe --tags --dirty)" >> $GITHUB_ENV
- name: Get Repo Owner
id: get_repo_owner
run: echo ::set-output name=repo_owner::$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')
run: echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" > $GITHUB_ENV
- name: Build ${{ matrix.svc }}
uses: docker/build-push-action@v2
with:
@ -37,18 +42,18 @@ jobs:
outputs: "type=image,push=false"
platforms: linux/amd64,linux/arm/v7,linux/arm64
build-args: |
VERSION=${{ steps.get_tag.outputs.TAG }}
VERSION=${{ env.TAG }}
GIT_COMMIT=${{ github.sha }}
tags: |
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/gateway:${{ steps.get_tag.outputs.TAG }}
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/gateway:${{ github.sha }}
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/gateway:latest
ghcr.io/${{ env.REPO_OWNER }}/gateway:${{ github.sha }}
ghcr.io/${{ env.REPO_OWNER }}/gateway:${{ env.TAG }}
ghcr.io/${{ env.REPO_OWNER }}/gateway:latest
build-auth-plugins:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.17.x]
go-version: [1.19.x]
svc: [
basic-auth
]
@ -60,12 +65,17 @@ jobs:
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Get TAG
id: get_tag
run: echo ::set-output name=TAG::latest-dev
- name: Get git commit
id: get_git_commit
run: echo "GIT_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Get version
id: get_version
run: echo "VERSION=$(git describe --tags --dirty)" >> $GITHUB_ENV
- name: Get Repo Owner
id: get_repo_owner
run: echo ::set-output name=repo_owner::$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')
run: echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" > $GITHUB_ENV
- name: Build ${{ matrix.svc }}
uses: docker/build-push-action@v2
with:
@ -74,6 +84,6 @@ jobs:
outputs: "type=image,push=false"
platforms: linux/amd64,linux/arm/v7,linux/arm64
tags: |
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/${{ matrix.svc }}:${{ steps.get_tag.outputs.TAG }}
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/${{ matrix.svc }}:${{ github.sha }}
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/${{ matrix.svc }}:latest
ghcr.io/${{ env.REPO_OWNER }}/${{ matrix.svc }}:${{ github.sha }}
ghcr.io/${{ env.REPO_OWNER }}/${{ matrix.svc }}:${{ env.TAG }}
ghcr.io/${{ env.REPO_OWNER }}/${{ matrix.svc }}:latest

View File

@ -24,14 +24,23 @@ jobs:
uses: docker/login-action@v1
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKER_PASSWORD }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
- name: Get TAG
id: get_tag
run: echo ::set-output name=TAG::${GITHUB_REF#refs/tags/}
run: echo TAG=${GITHUB_REF#refs/tags/} >> $GITHUB_ENV
- name: Get git commit
id: get_git_commit
run: echo "GIT_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Get version
id: get_version
run: echo "VERSION=$(git describe --tags --dirty)" >> $GITHUB_ENV
- name: Get Repo Owner
id: get_repo_owner
run: echo ::set-output name=repo_owner::$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')
run: echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" > $GITHUB_ENV
- name: Publish ${{ matrix.svc }}
uses: docker/build-push-action@v2
with:
@ -40,17 +49,18 @@ jobs:
outputs: "type=registry,push=true"
platforms: linux/amd64,linux/arm/v7,linux/arm64
build-args: |
VERSION=${{ steps.get_tag.outputs.TAG }}
VERSION=${{ env.TAG }}
GIT_COMMIT=${{ github.sha }}
tags: |
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/gateway:${{ steps.get_tag.outputs.TAG }}
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/gateway:${{ github.sha }}
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/gateway:latest
ghcr.io/${{ env.REPO_OWNER }}/gateway:${{ github.sha }}
ghcr.io/${{ env.REPO_OWNER }}/gateway:${{ env.TAG }}
ghcr.io/${{ env.REPO_OWNER }}/gateway:latest
publish-auth-plugins:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.17.x]
go-version: [1.19.x]
svc: [
basic-auth
]
@ -62,18 +72,27 @@ jobs:
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Get TAG
id: get_tag
run: echo ::set-output name=TAG::${GITHUB_REF#refs/tags/}
- name: Login to Docker Registry
uses: docker/login-action@v1
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKER_PASSWORD }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
- name: Get TAG
id: get_tag
run: echo TAG=${GITHUB_REF#refs/tags/} >> $GITHUB_ENV
- name: Get git commit
id: get_git_commit
run: echo "GIT_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Get version
id: get_version
run: echo "VERSION=$(git describe --tags --dirty)" >> $GITHUB_ENV
- name: Get Repo Owner
id: get_repo_owner
run: echo ::set-output name=repo_owner::$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')
run: echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" > $GITHUB_ENV
- name: Publish ${{ matrix.svc }}
uses: docker/build-push-action@v2
with:
@ -82,6 +101,6 @@ jobs:
outputs: "type=registry,push=true"
platforms: linux/amd64,linux/arm/v7,linux/arm64
tags: |
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/${{ matrix.svc }}:${{ steps.get_tag.outputs.TAG }}
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/${{ matrix.svc }}:${{ github.sha }}
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/${{ matrix.svc }}:latest
ghcr.io/${{ env.REPO_OWNER }}/${{ matrix.svc }}:${{ github.sha }}
ghcr.io/${{ env.REPO_OWNER }}/${{ matrix.svc }}:${{ env.TAG }}
ghcr.io/${{ env.REPO_OWNER }}/${{ matrix.svc }}:latest