Skip to content

Commit

Permalink
ci: add build-images workflow (#23)
Browse files Browse the repository at this point in the history
* ci: fix to use login-action

* ci: change to a test gitlab token

* ci: go back to non test token

* ci: update build-images event hook, add prefix

* ci: fix image build event on semver and pr
  • Loading branch information
jesseylin authored Jul 24, 2023
1 parent 02e35d9 commit 004a020
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
name: build-images

on:
workflow_dispatch
# push:
# branches:
# - "master"
# tags:
# - "v*"
# pull_request:
# branches:
# - "master"
workflow_dispatch:
push:
tags:
- "v*"
pull_request:
branches:
- "dev"

jobs:
docker:
Expand Down Expand Up @@ -44,12 +42,15 @@ jobs:
images: |
registry.gitlab.inria.fr/cromac/automateddiscoverytool/${{ matrix.image }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,event=tag,pattern={{version}},prefix=${{ github.head_ref || github.ref_name }}
- name: Login to Gitlab registry
if: github.event_name != 'pull_request'
run: docker login -u ${{ secrets.GITLAB_REGISTRY_USERNAME }} -p ${{ secrets.GITLAB_REGISTRY_PASSWORD }} registry.gitlab.inria.fr/cromac/automateddiscoverytool
uses: docker/login-action@v2
with:
registry: registry.gitlab.inria.fr/cromac/automateddiscoverytool
username: ${{ secrets.GITLAB_REGISTRY_USERNAME }}
password: ${{ secrets.GITLAB_REGISTRY_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v4
with:
Expand Down

0 comments on commit 004a020

Please sign in to comment.