Skip to content

Commit 837bec8

Browse files
committed
update github action
1 parent 67360b6 commit 837bec8

File tree

4 files changed

+42
-30
lines changed

4 files changed

+42
-30
lines changed

.github/workflows/dockerimage.yml

+30-24
Original file line numberDiff line numberDiff line change
@@ -12,42 +12,48 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: checkout
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v3
1616
with:
1717
fetch-depth: 0
1818

19-
- name: build and push to github packages
20-
uses: docker/build-push-action@v1
19+
- name: Log in to the ghcr
20+
uses: docker/login-action@v1
2121
with:
2222
registry: ghcr.io
2323
username: ${{ github.actor }}
2424
password: ${{ secrets.GITHUB_TOKEN }}
25-
tag_with_ref: true
26-
tag_with_sha: false
2725

28-
- name: build and push to docker hub
29-
uses: docker/build-push-action@v1
26+
- name: Log in to the docker
27+
uses: docker/login-action@v1
3028
with:
31-
repository: projecteru2/core
3229
username: ${{ secrets.DOCKER_USERNAME }}
3330
password: ${{ secrets.DOCKER_PASSWORD }}
34-
tag_with_ref: true
35-
tag_with_sha: false
3631

37-
- name: "[debug version] build and push to docker hub"
38-
uses: docker/build-push-action@v1
32+
- name: Docker meta
33+
id: meta
34+
uses: docker/metadata-action@v3
3935
with:
40-
build_args: KEEP_SYMBOL=1
41-
repository: projecteru2/core
42-
username: ${{ secrets.DOCKER_USERNAME }}
43-
password: ${{ secrets.DOCKER_PASSWORD }}
44-
tags: ${{ github.sha }}-debug
36+
images: |
37+
${{ github.repository }}
38+
ghcr.io/${{ github.repository }}
39+
tags: |
40+
type=ref,event=tag
4541
46-
- name: "[debug version] build and push to github packages"
47-
uses: docker/build-push-action@v1
42+
- name: Build and push image
43+
if: ${{ steps.meta.outputs.tags != '' }}
44+
uses: docker/build-push-action@v2
4845
with:
49-
registry: ghcr.io
50-
username: ${{ github.actor }}
51-
password: ${{ secrets.GITHUB_TOKEN }}
52-
build_args: KEEP_SYMBOL=1
53-
tags: ${{ github.sha }}-debug
46+
context: "."
47+
push: true
48+
tags: ${{ steps.meta.outputs.tags }}
49+
50+
- name: "[debug version] Build and push image"
51+
uses: docker/build-push-action@v2
52+
with:
53+
context: "."
54+
push: true
55+
build_args: |
56+
KEEP_SYMBOL=1
57+
tags: |
58+
${{ github.repository }}:${{ github.sha }}-debug
59+
ghcr.io/${{ github.repository }}:${{ github.sha }}-debug

.github/workflows/golangci-lint.yml

+9-3
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,19 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v3
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@v2
20+
with:
21+
go-version: 1.17.7
22+
1723
- name: golangci-lint
18-
uses: golangci/golangci-lint-action@v1
24+
uses: golangci/golangci-lint-action@v3
1925
env:
2026
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
2127
with:
2228
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
23-
version: v1.42
29+
version: v1.44.2
2430
# Optional: show only new issues if it's a pull request. The default value is `false`.
2531
only-new-issues: true

.github/workflows/goreleaser.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v3
1414
with:
1515
fetch-depth: 0
1616

@@ -21,7 +21,7 @@ jobs:
2121
- name: Set up Go
2222
uses: actions/setup-go@v2
2323
with:
24-
go-version: 1.17
24+
go-version: 1.17.7
2525

2626
- name: Run GoReleaser
2727
uses: goreleaser/goreleaser-action@v2

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ jobs:
1414
container: projecteru2/footstone:latest
1515

1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v3
1818
- name: unit tests
1919
run: make test

0 commit comments

Comments
 (0)