Skip to content

Commit e9fec8f

Browse files
update github CI (#946)
* feat: Configure l2geth Docker pipeline to push latest tag (#831) * push latest tag * push latest tag on release published * use metadata-action to define tags * test * push ref name on push tag or push latest tag on publishing release * update --------- Co-authored-by: Nazarii Denha <dengaaa2002@gmail.com>
1 parent 3d964d6 commit e9fec8f

File tree

3 files changed

+79
-1
lines changed

3 files changed

+79
-1
lines changed

.github/workflows/docker-arm64.yaml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Docker-arm64
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: "tag of this image (suffix -arm64 is added automatically)"
8+
required: true
9+
type: string
10+
11+
jobs:
12+
build-and-push-arm64-image:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
arch:
17+
- aarch64
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v2
22+
- name: Set up QEMU
23+
run: |
24+
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
25+
docker buildx create --name multiarch --driver docker-container --use
26+
- name: Set up Docker Buildx
27+
id: buildx
28+
uses: docker/setup-buildx-action@v2
29+
- name: Login to Docker Hub
30+
uses: docker/login-action@v2
31+
with:
32+
username: ${{ secrets.DOCKERHUB_USERNAME }}
33+
password: ${{ secrets.DOCKERHUB_TOKEN }}
34+
- name: Build docker image
35+
uses: docker/build-push-action@v2
36+
with:
37+
platforms: linux/arm64
38+
context: .
39+
file: Dockerfile
40+
push: true
41+
tags: scrolltech/l2geth:${{inputs.tag}}-arm64

.github/workflows/docker.yaml

+14-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
tags:
66
- '*'
7+
release:
8+
types: [published]
79

810
jobs:
911
build-and-push:
@@ -15,6 +17,16 @@ jobs:
1517
uses: docker/setup-qemu-action@v2
1618
- name: Set up Docker Buildx
1719
uses: docker/setup-buildx-action@v2
20+
- name: Extract docker metadata
21+
id: meta
22+
uses: docker/metadata-action@v3
23+
with:
24+
images: scrolltech/l2geth
25+
tags: |
26+
type=ref,event=tag,enable=${{ github.event_name == 'push' }}
27+
type=raw,value=latest,enable=${{ github.event_name == 'release' }}
28+
flavor: |
29+
latest=false
1830
- name: Login to Docker Hub
1931
uses: docker/login-action@v2
2032
with:
@@ -27,6 +39,7 @@ jobs:
2739
file: Dockerfile
2840
# push: ${{ startsWith(github.ref, 'refs/tags/') }}
2941
push: true
30-
tags: scrolltech/l2geth:${{github.ref_name}}
42+
tags: ${{ steps.meta.outputs.tags }}
43+
labels: ${{ steps.meta.outputs.labels }}
3144
# cache-from: type=gha,scope=${{ github.workflow }}
3245
# cache-to: type=gha,scope=${{ github.workflow }}

.github/workflows/semgrep.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
on:
2+
workflow_dispatch: {}
3+
pull_request: {}
4+
push:
5+
branches:
6+
- main
7+
- master
8+
paths:
9+
- .github/workflows/semgrep.yml
10+
schedule:
11+
# random HH:MM to avoid a load spike on GitHub Actions at 00:00
12+
- cron: 20 19 * * *
13+
name: Semgrep
14+
jobs:
15+
semgrep:
16+
name: semgrep/ci
17+
runs-on: ubuntu-20.04
18+
env:
19+
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
20+
container:
21+
image: returntocorp/semgrep
22+
steps:
23+
- uses: actions/checkout@v3
24+
- run: semgrep ci

0 commit comments

Comments
 (0)