test docker image #23
Workflow file for this run
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
name: Release | |
on: | |
push: | |
branches: | |
- semrel | |
env: | |
GITHUB_REPOSITORY: ${{ github.repository }} | |
GITHUB_SHA: ${{ github.sha }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- run: .github/workflows/set_github_env.sh | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build Container | |
uses: docker/build-push-action@v5 | |
with: | |
file: Dockerfile.test | |
tags: ${{env.IMAGE_SHA }} | |
#cache-from: type=registry,ref=user/app:latest | |
cache-to: type=inline | |
#outputs: type=docker,dest=/tmp/esi-opticks-${{ github.sha }}.tar | |
#- name: Upload image for test jobs | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: esi-opticks-${{ github.sha }} | |
# path: /tmp/esi-opticks-${{ github.sha }}.tar | |
- name: Test env | |
run: echo ,${{ env.REGISTRY }},${{ env.IMAGE_SHA }}, | |
test: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Define environment variables | |
run: | | |
REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') | |
REGISTRY=ghcr.io/$REPOSITORY | |
echo REGISTRY=$REGISTRY >> $GITHUB_ENV | |
echo IMAGE_SHA=${REGISTRY}/esi-opticks:${{ github.sha }} >> $GITHUB_ENV | |
#- name: Download Image | |
# uses: actions/download-artifact@v4 | |
# with: | |
# name: esi-opticks-${{ github.sha }} | |
# path: /tmp | |
- name: Run tests | |
run: | | |
#docker load --input /tmp/esi-opticks-${{ github.sha }}.tar | |
docker run ${{ env.IMAGE_SHA }} curl --version | |
release: | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Important for Semantic Release to analyze all commits | |
#- name: Semantic Release | |
# uses: cycjimmy/semantic-release-action@v4 | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
#- name: Download Image | |
# uses: actions/download-artifact@v4 | |
# with: | |
# name: esi-opticks-${{ github.sha }} | |
# path: /tmp | |
#- name: Release | |
# run: | | |
# docker load --input /tmp/esi-opticks-${{ github.sha }}.tar | |
# docker tag ghcr.io/${{ github.repository_owner }}/esi-opticks:${{ github.sha }} ghcr.io/${{ github.repository_owner }}/esi-opticks:latest | |
# docker tag ghcr.io/${{ github.repository_owner }}/esi-opticks:${{ github.sha }} ghcr.io/${{ github.repository_owner }}/esi-opticks:latest | |
# ${{ steps.semantic.outputs.new_release_version }} | |
# docker push ghcr.io/${{ github.repository_owner }}/esi-opticks:${{ github.sha }} |