WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 43c31db

Browse files
committed
Upgrade publish action
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
1 parent 4accc00 commit 43c31db

File tree

1 file changed

+26
-9
lines changed

1 file changed

+26
-9
lines changed

.github/workflows/publish.yaml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,52 @@ on:
88
jobs:
99
publish:
1010
runs-on: ubuntu-latest
11+
1112
steps:
13+
1214
- uses: actions/checkout@master
1315
- name: Install Go
1416
uses: actions/setup-go@master
1517
with:
16-
go-version: "1.23.x"
18+
go-version: 1.23.x
1719
- name: Set up QEMU
1820
uses: docker/setup-qemu-action@v3
21+
1922
- name: Set up Docker Buildx
2023
uses: docker/setup-buildx-action@v3
24+
2125
- name: Get TAG
2226
id: get_tag
23-
run: echo ::set-output name=TAG::${GITHUB_REF#refs/tags/}
24-
- name: Set up Docker Buildx
25-
uses: docker/setup-buildx-action@v3
27+
run: echo TAG=${GITHUB_REF#refs/tags/} >> $GITHUB_ENV
28+
29+
- name: Get git commit
30+
id: get_git_commit
31+
run: echo "GIT_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
32+
- name: Get version
33+
id: get_version
34+
run: echo "VERSION=$(git describe --tags --dirty)" >> $GITHUB_ENV
35+
- name: Get Repo Owner
36+
id: get_repo_owner
37+
run: echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" > $GITHUB_ENV
38+
2639
- name: Login to Docker Registry
2740
uses: docker/login-action@v3
2841
with:
29-
username: ${{ secrets.DOCKER_USERNAME }}
30-
password: ${{ secrets.DOCKER_PASSWORD }}
42+
username: ${{ github.repository_owner }}
43+
password: ${{ secrets.GITHUB_TOKEN }}
3144
registry: ghcr.io
45+
3246
- name: Push containers
3347
uses: docker/build-push-action@v6
3448
with:
3549
context: .
3650
file: ./Dockerfile
3751
outputs: "type=registry,push=true"
3852
platforms: linux/amd64,linux/arm64
53+
build-args: |
54+
GIT_COMMIT=${{env.GIT_COMMIT}}
55+
VERSION=${{env.VERSION}}
3956
tags: |
40-
ghcr.io/openfaas/cron-connector:${{ github.sha }}
41-
ghcr.io/openfaas/cron-connector:${{ steps.get_tag.outputs.TAG }}
42-
ghcr.io/openfaas/cron-connector:latest
57+
ghcr.io/${{ env.REPO_OWNER }}/cron-connector:${{ github.sha }}
58+
ghcr.io/${{ env.REPO_OWNER }}/cron-connector:${{ env.TAG }}
59+
ghcr.io/${{ env.REPO_OWNER }}/cron-connector:latest

0 commit comments

Comments
 (0)