Skip to content

Commit

Permalink
split build and push
Browse files Browse the repository at this point in the history
  • Loading branch information
rkm committed Mar 26, 2024
1 parent 92ef5b0 commit dd81a8b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,14 @@ jobs:
cd "software/$package"
img="ghcr.io/smi/${package,,}"
tag="$(grep _VERSION= Dockerfile | cut -d'"' -f2)"
echo "$img:$tag"
docker build . --tag "$img:$tag"
# echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
# docker push "$img:$tag"
docker tag "$img:$tag" "$img:latest"
# docker push "$img:latest"
echo "img=$img" >> "$GITHUB_ENV"
echo "tag=$tag" >> "$GITHUB_ENV"
- name: push image
if: github.ref == 'refs/heads/main'
run: |
set -euxo pipefail
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
docker push "$img:$tag"
docker push "$img:latest"

0 comments on commit dd81a8b

Please sign in to comment.