Skip to content

Commit

Permalink
Try SQuaRE build/push action.
Browse files Browse the repository at this point in the history
  • Loading branch information
ktlim committed Mar 12, 2024
1 parent 2c9e4b9 commit 9598822
Showing 1 changed file with 12 additions and 24 deletions.
36 changes: 12 additions & 24 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: CI build of all containers
on:
- push
- pull_request
push:
branches:
- main
tags:
- "*"
pull_request:

jobs:
push:
Expand All @@ -14,25 +18,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Build hinfo image
run: |
docker build . \
-f Dockerfile.hinfo \
--tag consdb-hinfo \
--label "runnumber=${GITHUB_RUN_ID}"
- name: Log in to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin

- name: Push image
run: |
ID=ghcr.io/${{ github.repository_owner }}/consdb-hinfo
if [[ "${{ github.ref }}" == "refs/pull/"* ]]; then
VERSION=$(echo "${{ github.head_ref }}" | sed -e 's|.*/||')
elif [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
VERSION=$(echo "${{ github.ref_name }}" | sed -e 's|^v||')
else
VERSION=latest
fi
docker tag consdb-hinfo $ID:$VERSION
docker push $ID:$VERSION
- name: Build hinfo
uses: lsst-sqre/build-and-push-to-ghcr@v1
with:
image: ${{ github.repository_owner }}/consdb-hinfo
github_token: ${{ secrets.GITHUB_TOKEN }}
dockerfile: Dockerfile.hinfo

0 comments on commit 9598822

Please sign in to comment.