-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from matter-labs/ci-fix
Proper tags for flux automation, other CI tweaks
- Loading branch information
Showing
2 changed files
with
50 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
name: Build and publish fee-withdrawer-v2 image | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- "main" | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
push_to_registry: | ||
|
@@ -20,10 +24,38 @@ jobs: | |
username: ${{ secrets.DOCKERHUB_USER }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Generate build ID for Flux Image Automation | ||
id: tag | ||
if: ${{ startsWith(github.ref, 'refs/tags') }} | ||
run: | | ||
echo "::set-output name=BUILD_ID::${GITHUB_REF#refs/*/}" | ||
- name: Generate build ID for Flux Image Automation | ||
id: build | ||
if: ${{ !startsWith(github.ref, 'refs/tags') }} | ||
run: | | ||
sha=$(git rev-parse --short HEAD) | ||
ts=$(date +%s) | ||
echo "::set-output name=BUILD_ID::${sha}-${ts}" | ||
- name: Build and push Docker image | ||
uses: docker/[email protected] | ||
if: ${{ startsWith(github.ref, 'refs/tags') }} | ||
with: | ||
push: true | ||
tags: | | ||
"matterlabs/fee-withdrawer-v2:latest" | ||
"matterlabs/fee-withdrawer-v2:${{ steps.tag.outputs.BUILD_ID }}" | ||
file: Dockerfile | ||
no-cache: true | ||
|
||
- name: Build and push Docker image | ||
uses: docker/[email protected] | ||
if: ${{ !startsWith(github.ref, 'refs/tags') }} | ||
with: | ||
push: true | ||
tags: "matterlabs/fee-withdrawer-v2:latest" | ||
tags: | | ||
"matterlabs/fee-withdrawer-v2:latest" | ||
"matterlabs/fee-withdrawer-v2:${{ steps.build.outputs.BUILD_ID }}" | ||
file: Dockerfile | ||
no-cache: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
name: CI | ||
|
||
on: [push] | ||
on: | ||
pull_request: | ||
branches: | ||
- "main" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
|
@@ -11,6 +18,13 @@ jobs: | |
|
||
- name: install dependencies | ||
run: yarn | ||
|
||
- name: running tests | ||
run: yarn test | ||
|
||
- name: test Docker image build | ||
uses: docker/[email protected] | ||
with: | ||
push: false | ||
file: Dockerfile | ||
no-cache: true |