Skip to content

Merge pull request #171 from nmfs-opensci/eeholmes-patch-2 #12

Merge pull request #171 from nmfs-opensci/eeholmes-patch-2

Merge pull request #171 from nmfs-opensci/eeholmes-patch-2 #12

Workflow file for this run

name: Docker Image test
on:
workflow_dispatch: null
push:
branches: test
jobs:
build:
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v3
with:
ref: test
- name: Login to GitHub Container Registry
if: github.repository == 'nmfs-opensci/py-rocket-base'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: Create short_sha tag
shell: bash
run: |
short_sha=$(echo "${{ github.sha }}" | cut -c1-7)
echo "tag=${short_sha}" >> $GITHUB_ENV
- name: Build the Docker image
if: github.repository == 'nmfs-opensci/py-rocket-base'
run: |
docker build . -f Dockerfile \
--tag ghcr.io/nmfs-opensci/py-rocket-base/test:latest \
--tag ghcr.io/nmfs-opensci/py-rocket-base/test:${{ env.tag }}
- name: Publish
if: github.repository == 'nmfs-opensci/py-rocket-base'
run: |
docker push ghcr.io/nmfs-opensci/py-rocket-base/test:latest
docker push ghcr.io/nmfs-opensci/py-rocket-base/test:${{ env.tag }}