update the CI (#21) #5
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: Publish Docker image | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
push_to_registry: | |
name: Push Docker image to Docker Hub | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: setup the environment | |
run: | | |
TAG=${GITHUB_REF#refs/*/} | |
REPO="docker.io/ohiosupercomputer" | |
echo "LATEST_IMG=$REPO/ood-doc-build:latest" >> $GITHUB_ENV | |
echo "VERSIONED_IMG=$REPO/ood-doc-build:$TAG" >> $GITHUB_ENV | |
- name: docker build and tag | |
run: | | |
docker build -t $LATEST_IMG . | |
docker tag $LATEST_IMG $VERSIONED_IMG | |
- name: login to dockerhub | |
run: docker login -u ${{ secrets.OSC_ROBOT_DOCKERHUB_USER }} -p ${{ secrets.OSC_ROBOT_DOCKERHUB_TOKEN }} | |
- name: push images to dockerhub | |
run: | | |
docker push $LATEST_IMG | |
docker push $VERSIONED_IMG |